Hello,

the following code fragment
~~~
function jsPostAppend(script, form_id)
{
 if(form_id)
  //parameters='&' + $(form_id).serialize() // first flavour
  parameters='&' + Form.serialize($(form_id)) // second flavour
[...]
~~~
works perfect for FF2, IE7 and Safari3 (in both flavours).

With Opera 9.x however, I get the following javascript errors:

First flavour:
~~~
JavaScript - https://.../file.php
Event thread: click
Error:
name: TypeError
message: Statement on line 47: Type mismatch (usually a non-object
value used where an object is required)
Backtrace:
  Line 47 of linked script https://.../file.js
    parameters = "&" + $(form_id).serialize();
  Line 1 of  script
    jsPostAppend("script.php", "form_submenu");
  At unknown location
    [statement source code not available]
~~~

Second flavour:
~~~
JavaScript - https://.../script.php
Event thread: click
Error:
name: TypeError
message: Statement on line 3388: Type mismatch (usually a non-object
value used where an object is required)
Backtrace:
  Line 3388 of linked script https://.../prototype/prototype.js
    key = element.name;
value = $(element).getValue();
  Line 701 of linked script https://.../prototype/prototype.js
    memo = iterator(memo, value, index);
  Line 595 of linked script https://.../prototype/prototype.js
    iterator(value, index++);
  Line 835 of linked script https://.../prototype/prototype.js
    iterator(this[i]);
  Line 596 of linked script https://.../prototype/prototype.js
    this._each((function (value)
{
  iterator(value, index++);
}

));
  Line 702 of linked script https://.../prototype/prototype.js
    this.each((function (value,index)
{
  memo = iterator(memo, value, index);
}

));
  Line 3386 of linked script https://.../prototype/prototype.js
    var data = elements.inject({}, (function (result,element)
{
  if (! element.disabled && element.name)
    {
      key = element.name;
      value = $(element).getValue();
      if (value != null && (element.type != "submit" || ! submitted &&
submit !== false && (! submit || key == submit) && (submitted =
true)))
        {
          if (key  in  result)
            {
              if (! Object.isArray(result[key]))
                result[key] = [result[key]];
              result[key].push(value);
            }
          else
            result[key] = value;
        }
    }
  return result;
}

));
  Line 3408 of linked script https://.../prototype/prototype.js
    return Form.serializeElements(Form.getElements(form), options);
  Line 47 of linked script https://.../file.js
    parameters = "&" + Form.serialize($(form_id));
  Line 1 of  script
    jsPostAppend("script.php", "form_submenu");
  At unknown location
    [statement source code not available]
~~~

Remark: form_submenu is a valid form.
According to the docs, Form.serialize() should return a string. Any
ideas? Thank you.

Tom

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to