【发布时间】:2014-11-12 19:35:55
【问题描述】:
我在同一页面上有两个表单,如下所示:
<section class="login_column box" >
<h3>For patients:</h3>
<form id="patients_form" name="patients_form" action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="POST">
<fieldset>
<p><label for="patient_login">Email:</label><input type="text" id="patient_login" name="patient_login" placeholder="Email" value="" required></p>
<p><label for="patient_password">Password:</label><input type="password" id="patient_password" name="patient_password" placeholder="Password" value="" required></p>
<p><label></label><button id="patients" style="margin-top:17px;" name="patients" type="submit"> Login </button></p>
</fieldset>
</form>
</section>
<section class="login_column box">
<h3>For physicians:</h3>
<form id="physicians_form" name="physicians_form" action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="POST">
<fieldset>
<p><label for="physician_login">Email:</label><input type="text" id="physician_login" name="physician_login" placeholder="Email" value="" required></p>
<p><label for="physician_password">Password:</label><input type="password" id="physician_password" name="physician_password" placeholder="Password" value="" required></p>
<p><label></label><button id="physicians" name="physicians" style="margin-top:17px;" value="Login" type="submit"> Вход </button></p>
</fieldset>
</form>
</section>
当某些提交按钮被按下时,第一个表单被提交,即使第二个提交按钮可能被按下。如何保证每个提交按钮只提交自己的表单?
【问题讨论】:
-
您有实时网址吗?还是我们可以看看的Demo?这可能会有很大帮助。
-
是的,我有,但它是西里尔文。希望不会有问题。 scanner.strangerstudio.net/…
标签: form-submit forms