js solution to disabled problem in web form submission_javascript skills
WBOYOriginal
2016-05-16 16:20:321721browse
The example in this article describes the js solution to the disabled problem in web form submission. Share it with everyone for your reference. The specific analysis is as follows:
When we submit the form, the pname data cannot be obtained in the background because the attribute of the input box is disabled. The value can be saved and the user cannot input this function. There are the following solutions:
1. Change the disabled="disabled" attribute to readonly="readonly" instead. Its function is basically the same. Readonly can also support onfocus events. (Recommended)
3. Get the value of pname using js, pass it in parameter form, and modify the action value of the form. Of course, this requires modifying the background code to obtain the parameter (getParameter);
A little suggestion: When we write scripting languages, we are generally keen on writing in jQuery because it is very concise. jQuery encapsulates javascript. When getting the equivalent value of HTML, use regular expression matching to obtain it,
Therefore, efficiency will inevitably be affected, so it is recommended that you generally use JavaScript when there are a large number of scripts.
I hope this article will be helpful to everyone’s JavaScript programming design.
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