【发布时间】:2016-12-06 19:47:43
【问题描述】:
我的页面包含以下内容:
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp">
Username: <input type="text" name="usrname" required>
</form>
<div class="map"></div>
<div><p>Some content to explain some things</p></div
<form action="demo_form.asp">
Username: <input type="text" name="lastusrname" required>
<input type="submit">
</form>
<p><strong>Note:</strong> The required attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
</body>
</html>
当您单击提交时,它仅检查包含输入提交的第二个表单。我假设我需要编写一些 JQuery 或 Javascript 函数来检查是否填写了所有必填字段?
两个表格的原因是表格之间有其他html
【问题讨论】:
-
为什么这里特别需要两个表格?如果你只是想在它之间有一张地图,它可以驻留在表单标签内。
标签: javascript jquery html forms css