[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-09-04 Thread T.J. Crowder
E.g.: var data = $('myform').serialize(true); data.more = "stuff"; new Ajax.Updater(id, url, { parameters: data }); -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 4, 4:56 pm, Daniel Rubin wrote: > Senthil Krishnamoorthy wrote: > > Actually I w

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-09-04 Thread Daniel Rubin
Senthil Krishnamoorthy wrote: > Actually I want to pass form parameter as well as other my defined > parameters to the Ajax.Updater. How do i do that. Basically > Ajax.Updater is recognizing the either form.serialize or {} hash > parameters. > > Anybody help me out how to pass the both in param

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-02-14 Thread Ralph
Hello again, thanks, my input fields had no name attribute, now it works! sorry for doubleposting. Best Regards, Ralph On 14 Feb., 12:16, "T.J. Crowder" wrote: > Hi, > > Have you inspected formhash in Firefox to make sure that it contains > other fields?  That code should work fine.  Do your

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-02-14 Thread T.J. Crowder
Hi, Have you inspected formhash in Firefox to make sure that it contains other fields? That code should work fine. Do your form fields have names (not just ids)? Complete working example; the server side (not given) just echoes the parameters in an HTML fragment: http://pastie.org/389054 HTH,

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-02-14 Thread Ralph
Hello, I tried the same and adding new key with values worked very good, thanks. I've got another problem, my form won't send data. Only orderID is transmitted via post. (all id-attributtes are set) function updateOrder(orderID) { var formhash = $('form'+orderID).serialize(true);

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-02-14 Thread Ralph
Hello, I have used the hints you've posted before and I can add new keys with values to my hash (thanks very much for that), but it doesn't serialize my formelements: function updateOrder(orderID) { var formhash = $('form'+orderID).serialize(true); formhash.orderID = orderID;

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-31 Thread coruscant
Ok, I got it to run now. Thank you very much for your help. I guess your last post is worth to be added to the documentation of form.serialize, I think it could help other people to save some time. Best Regards, Benedikt. --~--~-~--~~~---~--~~ You received this mes

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-23 Thread T.J. Crowder
Hi, Whenever you're faced with this sort of thing, your best bet is to use a debugger and inspect what you're really getting back, perhaps even using it to walk through the Prototype code to see what's going on, read through the Prototype code you're using, etc. Doing that can be a very fast way

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-23 Thread coruscant
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

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-23 Thread T.J. Crowder
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 wrote: > Hi,

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-23 Thread coruscant
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'

[Proto-Scripty] Re: Ajax.Updater - Sending form.serialize + other variables

2009-01-23 Thread T.J. Crowder
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