Home>Article>Web Front-end> How to determine whether the content of the text box in html is empty
There are many ways to determine whether the content of the text box in the form is empty: 1. Judge through thephp
statement 2. Throughjs
Statement judgment 3. Judge throughhtml
native statements.
1. Determine through thePHP
statement:
Content in html:
Content in php:
//submit.php 0) echo '不空'; else echo '空 '; ?>
2. Judgment byJS
statement
JS判断input是否为空
3. Judgment byrequired
attribute
表单