Can you get a form's values in an array form by using JS? I'm referring to the POST method when I mention arrays. For example
$('myform').values or something?
whoisgregg
1:30 pm on May 25, 2007 (gmt 0)
If you are using Prototype (which I'm guessing you are from the $() function), then it's just that simple. Use the Form.serialize [prototypejs.org] function:
var formArray = $('form-id').serialize(true);
ahmedtheking
9:19 pm on May 26, 2007 (gmt 0)
Ok cool. Nice guess! I've never really played with 'serialize', what does it do?
whoisgregg
6:17 pm on May 29, 2007 (gmt 0)
It does what you asked for... returns the form values in an array. :)