Home>Article>Web Front-end> How to determine whether the content of the text box in html is empty

How to determine whether the content of the text box in html is empty

autoload
autoload Original
2021-03-30 15:38:28 11437browse

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 thephpstatement 2. ThroughjsStatement judgment 3. Judge throughhtmlnative statements.

1. Determine through thePHPstatement:

Content in html:

Content in php:

//submit.php 0) echo '不空'; else echo '空 '; ?>

2. Judgment byJSstatement

  JS判断input是否为空  

3. Judgment byrequiredattribute

     表单 

Recommended: "htmlknowledge"

The above is the detailed content of How to determine whether the content of the text box in html is empty. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn