我正在尝试做以下事情:
<div id="div1"....>
<div id="div2"....>
<form name="form1" .....>
<input type="text">
<input type="submit" value="submit1">
</form>
<form name="form2" .....>
<input type="text">
</div> //End of Div2
<div id="div3" ...>
<input type="submit" value="submit2"......>
</form> //End of form2
</div> //End of Div3
</div> //End of Div1
但每次form
关闭都在div2
内。因此,submit input
来自form
,点击后未提交form
。请帮忙。
根据我的项目需要,我的div
职位在这里。有没有办法维持form
和div
按钮/关闭submit
以外的div
开头?
答案 0 :(得分:0)
form
的开始和结束标记应位于同一div
父
尝试这样的事情:
<div id="div1"....>
<div id="div2"....>
<form name="form1" .....>
<input type="text">
<input type="submit" value="submit1">
</form>
</div> //End of Div2
<div id="div3" ...>
<form name="form2" .....>
<input type="text">
<input type="submit" value="submit2"......>
</form> //End of form2
</div> //End of Div3
</div> //End of Div1
答案 1 :(得分:0)
您的代码应如下所示。
<div id="div1"....>
<div id="div2"....>
<form name="form1" .....>
<input type="text">
<input type="submit" value="submit1">
</form>
<form name="form2" .....>
<input type="text">
<div id="div3" ...>
<input type="submit" value="submit2"......>
</div> //End of Div3
</form> //End of form2
</div> //End of Div2
</div> //End of Div1
答案 2 :(得分:0)
我不确定你究竟需要什么,但我清理了一下,也许这就是你要找的东西:
<div id="div1">
<form>
<input type="text" name="from1">
<input class="submit" type="submit" value="Submit1">
</form>
</div>
<div id="div2">
<form>
<input type="text" name="from2">
<input class="submit" type="submit" value="Submit2">
</form>
</div>