[英]how can i transfer to section of another page after submit form data?
I want to send my form data to another page by POST method so that be load focuse other page in my specify section. 我想通过POST方法将表单数据发送到另一个页面,以便在我的指定部分中将焦点放在另一个页面上。 How can i do it?
我该怎么做?
<form method="post" id="loginForm" action="/index.php"> <table> <tr> <td><label class="labelShadow">User Name: </label></td> <td><input type="text" name="uName" class="loginBox" value="<?php if(isset($_COOKIE['uName']))echo $_COOKIE['uName']; ?>" /></td> </tr> <tr> <td><label class="labelShadow">Password: </label></td> <td><input type="password" name="pass" class="loginBox" value="<?php if(isset($_COOKIE['pass']))echo $_COOKIE['pass']; ?>" /></td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Login" name="login" class="btn btn-default" <?php callRouter(); if(isset($_SESSION['privilege']))echo "disabled"; ?>/> <input type="checkbox" class="checkBoxShodow" name="cookieChk" <?php if(isset($_COOKIE['pass']))echo "checked"; ?> /> <label class="labelShadow"> remember me</label> </td> </tr> </table> </form>
If i understand the question correctly, you only need to add an anchor to the form's action like so: 如果我正确理解了该问题,则只需要向表单的操作添加锚即可,如下所示:
<form method="post" id="loginForm" action="/index.php#focus-on-section">
the anchor can be any element with an id
on your other page: 锚点可以是其他页面上具有
id
任何元素:
<div id="focus-on-section">
more stuff
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.