I have a form, as such
<form action="search.php" method="get" id="search">
<input type="text" name="first_name"/>
<input type="text" name="last_name"/>
<input type="submit" value="Go" id="submit"/>
</form>
I want to make sure the data is valid, so I have a php file I can make an ajax request to access a database, which returns xml as such
<id="111111" first_name="Tom" last_name="Hanks" />
If there is a matching name. There should be no name conflicts. “HTTP/1.1 404 File Not Found” is printed otherwise. After this is done, I want to reach search.php with first_name, last_name, and id. That is, I want to be at:
search.php?first_name=Tom&last_name=Hanks&id=111111
How would I go about this ?
your scenario is similar to the followings, which im sure, you can churn to your own flavors.
[1] http://www.the-art-of-web.com/javascript/ajax-validate/
[2] http://www.dev102.com/2008/05/21/create-interactive-form-validation-using-ajax/