Jump to HTML anchor automatically when PHP form submits

前端 未结 1 856
有刺的猬
有刺的猬 2021-01-24 01:56

I am trying to add a form into my index page, so that when you click on submit it will automatically return to the form when the page reloads. Right now if there are any errors

相关标签:
1条回答
  • 2021-01-24 02:17

    Add an ID to the form and append the anchor onto the form action URL

    <form method="post" id="myform" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>#myform">

    0 讨论(0)
提交回复
热议问题