Hi I'm a newbie to AJAX and prototype and am writing a simple
application that calculates some figures in php given some variables
from a form, and display the outcome in a DIV. I can get it to
function using a single parameter like this:
function doSums() {
new Ajax.Updater('fruits', 'calculator2.php', { method: 'post',
parameters: salary=$('salary').serialize(true) });
return false;
}
but I can't pass more than 1 form element. I have tried:
parameters: salary=$('salary'), age=$('age').serialize(true)
and
parameters: $F('salary'), $F('age').serialize(true)
on 13.05.2008 08:03
on 13.05.2008 08:05
Apologies: I am using prototype.js
on 13.05.2008 10:44
I also have tried this but no go:
new Ajax.Updater('fruits', 'calculator2.php', { method: 'post',
parameters: Form.serialize(this) });
on 13.05.2008 11:14
The answer is this (I was close, just needed to be more specific):
new Ajax.Updater('fruits', 'calculator2.php', { method: 'post',
parameters: form1.serialize() });