我有这样的表格
<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>
我想确保数据有效,因此我有一个php文件,可以发出ajax请求来访问数据库,该数据库将返回xml
<id="111111" first_name="Tom" last_name="Hanks" />
是否有匹配的名称。不应有名称冲突。否则将打印“找不到HTTP / 1.1 404文件”。完成此操作后,我想使用first_name,last_name和id到达search.php。也就是说,我想去:
search.php?first_name=Tom&last_name=Hanks&id=111111
我将如何处理?
最佳答案
您的情况类似于以下情况,可以肯定的是,您可以根据自己的口味调配。
[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/
关于php - 表单验证,PHP和JavaScript,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6222255/