PDA

View Full Version : Ajax form POST help


turnipofdoom
06-18-2007, 01:28 AM
I would like to post a form via ajax to a php file

The file is index.php, the string passed in has to be ?do=xyz
The form data we need looks like this


<form>
<tr>
<td class="alt1">A:&nbsp;</td>
<td class="alt1"><input name="post_array[A]" type="text" value="$a" size="10"></td>
</tr>

<tr>
<td class="alt1">B:&nbsp;</td>
<td class="alt1"><input name="post_array[B]" type="text" value="$b" size="10"></td>
</tr>
<tr>
<td class="alt1">
<div align="center"><input name="Edit" type="submit" id="Edit" value="Update"></div>
</td>
</tr>
</form>


The variables that display its current value are set on teh way into the page, they display.
I really dont know a whole lot about AJAX, and none of the examples I could find included dealing with arrays from forms.

The php script expects post_array to be an array so it can foreach over it and use key + value for db inserts/updates.

Thanks in advance for any help/flames. <3

Dismounted
06-18-2007, 06:42 AM
Look in the Articles section, I remember there being a tutorial by Zero Tolerance.