如何将表单提交到同一域中没有表单 ID 或名称的另一个页面?
需要提交到另一个页面的表单:
<form id="login_form" action="roundcube" method="post">
<div class="input-req-login">
<label for="user">Email Address</label>
</div>
<div class="input-field-login icon username-container">
<input name="_user"
id="rcmloginuser"
autofocus="autofocus"
placeholder="Enter your email address."
class="std_textbox"
type="text"
tabindex="1" required>
</div>
<div style="margin-top:30px;" class="input-req-login">
<label for="pass">Parola</label>
</div>
<div class="input-field-login icon password-container">
<input name="_pass"
id="rcmloginpwd"
placeholder="Enter your email password."
class="std_textbox"
type="password"
tabindex="2" required>
</div>
<div class="controls">
<div class="login-btn">
<button type="submit"
onclick="document.getElementByName("form").submit()"
tabindex="3">Autentificare</button>
</div>
目标形式:
<form name="form" action="./" method="post">
<input type="hidden" name="_token" value="543e98f5e6cc25841fc0df79cb939590">
<input type="hidden" name="_task" value="login">
<input type="hidden" name="_action" value="login">
<input type="hidden" name="_timezone" id="rcmlogintz" value="_default_">
<input type="hidden" name="_url" id="rcmloginurl" value="">
<table>
<tbody>
<tr>
<td class="title">
<label for="rcmloginuser">Utilizator</label>
</td>
<td class="input">
<input name="_user"
id="rcmloginuser"
size="40"
autocapitalize="off"
autocomplete="off"
type="text">
</td>
</tr>
<tr>
<td class="title">
<label for="rcmloginpwd">Parolă</label>
</td>
<td class="input">
<input name="_pass"
id="rcmloginpwd"
size="40"
autocapitalize="off"
autocomplete="off"
type="password">
</td>
</tr>
</tbody>
</table>
<p class="formbuttons">
<input type="submit"
class="button mainaction"
value="Autentificare" />
</p>
</form>