Solution to the problem that the value cannot be obtained after the input is disabled_Experience exchange

WBOY
Release: 2016-05-16 12:04:33
Original
1845 people have browsed it


The value cannot be obtained after submission in the form form .
Change disabled="disabled" to readonly = "readonly"
Follow W3C specifications: http://www.w3.org/TR/REC-html40/interact/forms.html#h- 17.12
Input set to disabled will have the following restrictions:
Cannot receive focus
Will be skipped when using the tab key
May not be successful

Set to readonly The input will have the following restrictions:
It can receive focus but cannot be modified
It can use the tab key to navigate
It may be successful
Only successful form elements are valid data, that is, Submission is possible. The value attribute of disabled and readonly text input boxes can only be modified through scripts.

Related labels:
source:php.cn
Statement of this Website
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!