J
jim whitaker
I followed this tutorial, and I have it working.
http://www.webpasties.com/xmlHttpRequest/
My question is this:
After an AJAX form receives it's data from the server, how could i then
submit (post) that data to another php file?
IN other words, An order entry system where the ajax fills the form with
shipping address. Then there are a few other fields to fill out, then I
want to hit a submit button that post to uptate.php.
When I try this there are errors. Its as though only the original ajax
request will work. To me this is the whole idea of ajax, to auto fill some
form fields. But, what good is it if you can't post to somewhere the data
you retrived. Surely an order system needs to post data to the orders
table.
Please help, I've been at this for a week. Below is the modified html
portion of the form.
I added the submit button. Only testing at this point, no real application
yet. I have a php version, but you know all the pages involved. That's why
I'm trying to move some forms to ajax / javascript. I am new at the ajax
thing.
<form method="POST action="http://localhost/basic/ptest/update.php">
<p>
ZIP code:
<input type="text" size="5" name="zip" id="zip"
onblur="updateCityState();" />
</p>
City:
<input type="text" name="city" id="city" />
State:
<input type="text" size="2" name="state" id="state" />
<p><input type="submit" value="Submit" name="B1"></p>
</form>
http://www.webpasties.com/xmlHttpRequest/
My question is this:
After an AJAX form receives it's data from the server, how could i then
submit (post) that data to another php file?
IN other words, An order entry system where the ajax fills the form with
shipping address. Then there are a few other fields to fill out, then I
want to hit a submit button that post to uptate.php.
When I try this there are errors. Its as though only the original ajax
request will work. To me this is the whole idea of ajax, to auto fill some
form fields. But, what good is it if you can't post to somewhere the data
you retrived. Surely an order system needs to post data to the orders
table.
Please help, I've been at this for a week. Below is the modified html
portion of the form.
I added the submit button. Only testing at this point, no real application
yet. I have a php version, but you know all the pages involved. That's why
I'm trying to move some forms to ajax / javascript. I am new at the ajax
thing.
<form method="POST action="http://localhost/basic/ptest/update.php">
<p>
ZIP code:
<input type="text" size="5" name="zip" id="zip"
onblur="updateCityState();" />
</p>
City:
<input type="text" name="city" id="city" />
State:
<input type="text" size="2" name="state" id="state" />
<p><input type="submit" value="Submit" name="B1"></p>
</form>