2013-01-03 153 views
0

我有这样的代码HTML提交按钮

  1. 文件的search.php

<html> <head> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script> </script> <?php if(isset($_POST['bt_submit'])){ header('Location: accueil.php?region='); } ?> <style> body { background-image: url(../images/paper_03.png); } form { background-image: url(../images/paper_02.png); } </style> </head> <body> <form name="search" method="post" > <form name="map" style="position: relative; top:10px; left:300px; width: 400px; height: 130px;"> jjjjjjjjjjjjjjjjj </form> <form name="advanced" style="position: relative; top:10px; left:300px; width: 400px; height: 130px;" action="blabla.php"> <form name="location" style="position: relative; top:10px; left:300px; width: 300px; height: 90px;"> <div style="background-color:99FFFF"><font color="blue">Location</font></div> <table> <tr> <td>Region: </td><td ><select style="width:200px" name="region"> <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> <tr> <td>City: </td><td colspan="3"><input type="text" style="width:200px" name="city" /> </td> </tr> <tr> <td>State/Province: </td><td colspan="3"><select style="width:200px"> <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> <tr> <td>Country: </td><td colspan="3"><select style="width:200px" > <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> </table> </form> <form name="keywords" style="position: relative; top:10px; left:300px; width: 400px; height: 50px;" > <div style="background-color:99FFFF"><font color="blue">Keywords</font></div> <table> <tr> <td colspan="2">Keywords: </td><td ><input type="text" style="width:225px" name="keywords" /> </td> </tr> </table> </form> <form name="company" style="position: relative; top:10px; left:300px; width: 400px; height: 50px;" > <div style="background-color:99FFFF"><font color="blue">Company</font></div> <table> <tr> <td>Company: </td><td colspan="3"><select style="width:230px"> <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> </table> </form> <form name="job_category" style="position: relative; top:10px; left:300px; width: 400px; height: 50px;"> <div style="background-color:99FFFF"><font color="blue">Job category</font></div> <table> <tr> <td>Job category: </td><td colspan="3"><select style="width:210px"> <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> </table> </form> <form name="dates" style="position: relative; top:10px; left:300px; width: 400px; height: 50px;"> <div style="background-color:99FFFF"><font color="blue">Dates</font></div> <table> <tr> <td>Date range: </td><td colspan="3"><select style="width:225px"> <option value="1">truc</option> <option value="1">truc</option> <option value="1">truc</option> </select> </td> </tr> </table> </form> </form> <input type="submit" name="bt_submit" value="Search Now" style="position: relative; left:400px; width: 100px" /> </form> </body> </html>

该文件包含PHP和HTML代码.the接口包含两个部分:第一是一种形式,第二个是一组必须由按钮 我的问题是,当我在提交验证重定向没有工作,什么都不做形式的按钮,点击提交表单。所以我需要知道

  1. 为什么呢?
  2. 如何解决这个问题?
+0

对于一个......可以的形式被嵌套这样的形式中?如果可以的话,那对我来说似乎是一个可怕的主意。另外,确保提交按钮位于您想要提交的表单中。 – Mike

+0

你有什么缩进设置? – Amyth

回答

2

你只需要一个<form>。您可能需要使用<fieldset>元素将表单的各个部分组合在一起,但通过使用多个表单,可以将它们完全分开处理。

0
<?php 
if(isset($_POST['bt_submit'])){ 
header('Location: accueil.php?region='); 
} 
?> 

把这段代码放在你页面的顶部,甚至在html的单个字母表之前。当事情已经显示

+0

而sooooooo很多形式!那些需要清洁 –

0

你不能有嵌套的表格头不起作用。再加上每个输入在代码中显然是不同的形式。你将不得不更新它以单一形式。