我正在尝试在1个PHP代码中创建2个表单堆叠。 但表格根本无法提交。它只是坐在那里而没有将这个表格传递给action =“...”
这里是第一种形式的编码(注册)
<form id="RegForm" class="form" action="PHP/Enter_New.php" method="post">
<!-- Progress Bar -->
<ul id="ProgressBar">
<li class="active">Access Code</li>
<li>Account Setup</li>
<li>User Agreement</li>
</ul>
<!-- Fieldsets -->
<fieldset>
<h2 class="fs-title">Are you lost?</h2>
<h3 class="fs-subtitle">Get your access code before enter!!</h3>
<input type="text" name="invite" class="invite field" placeholder="Access Code" onkeyup="checkAvAccess()" autocomplete='off' required />
<br />
<img src="/Images/Gif/Checking.gif" id="loaderIcon-access" style="display:none" />
<span id="availability-status-access"></span>
<br />
<input type="button" name="login" class="action-button" id="toLog" value="Login" />
<input type="button" name="next" class="next action-button" id="access" value="Next" disabled="disabled" />
</fieldset>
<fieldset>
<h2 class="title">Account setup</h2>
<h3 class="subtitle">Login information</h3>
<input type="text" name="username" class="username field" id="regUsername" placeholder="Username" onkeyup="checkAvReg()" autocomplete='off' />
<img src="/Images/Gif/Checking.gif" id="loaderIcon-reg" style="display:none" />
<span id="availability-status-reg"></span>
<input type="password" name="password" class="password field" id="password" placeholder="Password" required />
<div class="pwstrength_viewport_progress"></div>
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="button" name="next" class="next action-button" id="logInfo" value="Next" disabled="disabled" />
</fieldset>
<fieldset>
<h2 class="fs-title">User Agreement</h2>
<h3 class="fs-subtitle">By signup at our website... </h3>
<input type="button" name="previous" class="previous action-button" value="Previous" />
<input type="submit" name="submit" class="submit action-button" id="subRegister" value="Submit" disabled="disabled"/>
</fieldset>
注册表关闭后,那里没有其他代码..登录代码后的下一个代码
<form id="LoginForm" class="form" name="login" action="PHP/Redirrect_to.php" method="post">
<fieldset>
<h2 class="fs-title">Enter Website</h2>
<h3 class="fs-subtitle">Please login to continue!!</h3>
<input type="text" name="username" class="username field" id="login" placeholder="Username" onkeyup="checkAvLogin()" autocomplete='off' required />
<img src="/Images/Gif/Checking.gif" id="loaderIcon-login" style="display:none">
<span id="availability-status-login"></span>
<input type="password" name="password" class="password field" placeholder="Password" required />
<div class="pwstrength_viewport_progress"></div>
<input type="button" name="register" class="action-button" id="toReg" value="Register" />
<input type="submit" name="submit" class="submit action-button" id="subLogin" value="Submit" formaction="PHP/Redirrect_to.php" formmethod="post" disabled="disabled" />
</fieldset>
请注意,在onkeyup =“..”后,js会删除提交输入上的禁用值。值= true
你会看到那里有很多下一个和前一个因为我使用多步骤基本形式。 Here the original code。我从js
中删除了返回false值答案 0 :(得分:0)
永远不要将提交按钮命名为“提交”
<input type="submit" name="submit" ... /> <-- bad name
<input type="submit" name="anyNameButSubmit" ... /> <-- good name
Form submit button will not submit when name of button is "submit"