Hi,
thanks, this was a silly mistake. I corrected it to:
var formhash = $('myform').serialize(true);
Anyway the error message is still the same:
"formhash.set is not a function"
I am using prototype 1.6. I also get the error when trying not to do
the Form#serialize thing but rather call a new hash with
var formhash = new hash();
I really have no clue what I should try next.
Best Regards,
Benedikt.
On 23 Jan., 12:44, "T.J. Crowder" <[email protected]> wrote:
> Hi,
>
> You need to pass 'true' to serialize() to get a hash rather than a
> string. See the Form#serialize docs referenced earlier for details.
>
> HTH,
> --
> T.J. Crowder
> tj / crowder software / com
> Independent Software Engineer, consulting services available
>
> On Jan 23, 10:28 am, coruscant <[email protected]> wrote:
>
> > Hi,
>
> > thank you for your reply.
>
> > I tried to incorporate this in my script which is now looking like
> > this:
>
> > var formhash = $('myform').serialize();
>
> > formhash.set('key1', 'value1');
> > formhash.set('key2', 'value2');
> > formhash.set('key3', 'value3');
>
> > new Ajax.Updater(rettab, '$script', {
> > method: 'post',
> > parameters: formhash.map,
> > evalScripts: 'true'
> > });
>
> > Anyway I get the return error:
> > "formhash.set is not a function"
>
> > Can you please tell me what I am doing wrong?
>
> > Thanks again,
> > Benedikt.
>
> > On 23 Jan., 10:00, "T.J. Crowder" <[email protected]> wrote:
>
> > > Hi,
>
> > > Form#serialize[1] returns a Hash object[2] when you call it with
> > > 'true' as the getHash parameter (as you are). So just do that
> > > *before* your Ajax.Updater call, and add your further items to the
> > > Hash, and then pass the Hash into the updater call.
>
> > > [1]http://prototypejs.org/api/form/serialize
> > > [2]http://prototypejs.org/api/hash
>
> > > HTH,
> > > --
> > > T.J. Crowder
> > > tj / crowder software / com
> > > Independent Software Engineer, consulting services available
>
> > > On Jan 23, 8:53 am, coruscant <[email protected]> wrote:
>
> > > > Hello All,
>
> > > > I want to use Ajax.updater in one of my PHP scripts. I would like to
> > > > send all the variables of a form to the server, therefore I use the
> > > > form serialize method. Anyway I need to tell the server other
> > > > variables that are not and can not be in the form. Is it somehow
> > > > possible to do this?
>
> > > > I tried things like:
>
> > > > new Ajax.Updater('rettab', '$script', {
> > > > method: 'post',
> > > > parameters: $('thisform').serialize(true), {variable1: 'input',
> > > > variable2: 'otherinput', variable3: 'somestring'},
> > > > evalScripts: 'true'
> > > > });
>
> > > > Also this way does not work:
>
> > > > new Ajax.Updater('rettab', '$script', {
> > > > method: 'post',
> > > > parameters: {$('thisform').serialize(true), variable1: 'input',
> > > > variable2: 'otherinput', variable3: 'somestring'},
> > > > evalScripts: 'true'
> > > > });
>
> > > > And this way doesn't work either:
>
> > > > new Ajax.Updater('rettab', '$script', {
> > > > method: 'post',
> > > > parameters: $('thisform').serialize(true),
> > > > parameters: {variable1: 'input', variable2: 'otherinput', variable3:
> > > > 'somestring'},
> > > > evalScripts: 'true'
> > > > });
>
> > > > Does anybody have an idea?
>
> > > > Thanks in advance.
>
> > > > Benedikt.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---