duanhan4763 2018-07-25 09:45
浏览 24
已采纳

提交联系表后,如何到达页面上的特定位置?

After clicking the submit button it will automatically go to the top of the page. Especially on a mobile you will not be able to see the thank you message (Thank you for your message). Below you'll find the code.

<input type="submit" id="submit" name="submit" value="Send Message">
</div><!-- end .submit -->
</form>
<?php else: ?>
<p style="font-size:13pt; font-weight:bold; font-family:Cambria, Times, 'Times New Roman', serif; color:#0F243E; margin-left:0px;">Thank you for your Message!</p>
<script type="text/javascript"> 
setTimeout('ourRedirect()', 9000)
function ourRedirect () {
location.href='../'
}
</script>
<?php endif; ?>
</div> <!-- end form -->

I have been trying all sorts of things but none of them seem to work. Does anyone have an idea? Thank you!

  • 写回答

3条回答 默认 最新

  • dqyz48470 2018-07-25 17:21
    关注

    Just found an easy solution myself.

    Just add #thanks or any other name you want to address.

    <form action="yourpage.php#thanks">
    

    Put code below anywhere you want it to go after submitting.

    <a name="thanks"></a>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探