php - The form is submitted to action. The user input is illegal and a prompt is required. How to deal with it?
漂亮男人
漂亮男人 2017-05-24 11:34:13
0
1
482
<form role="form" action="verify.php" method="post">
      <input type="text" name="test" placeholder="xxx" >
      <button type="submit" class="btn">登 录</button>
</form>

verify.php determines whether the input is illegal. If it is illegal, how can the user be prompted?

ps: If you use jquery to bind the button, you can. But I want to know if the submission method like form/action can output the judgment result to the front desk?

漂亮男人
漂亮男人

reply all(1)
淡淡烟草味
  • If you use jq’s ajax method, you can load the error reminder to the end of the form

  • If you only use PHP, you can only add the error message and re-render the page

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template