Home  >  Article  >  Web Front-end  >  Form processing_html/css_WEB-ITnose

Form processing_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:18:331268browse

checkbox

When I submit data, the option in the form is cleared because other data validation fails. How can I do it even if it is submitted? , after the data verification fails, the checkbox option will still be retained and will not be reset

Reply to the discussion (solution)

Just use ajax for your verification. There is no need to refresh everything. Verify each form field separately. Do not verify after submitting the entire form.

Just use ajax for your verification. There is no need to refresh everything. Verify each form field separately. Do not verify after submitting the entire form.

Other controls in the entire form field include text boxes, radio boxes, multi-select boxes, and file upload controls. They are all ASP controls. The checkbox is an HTML control. When the submission verification fails, except for the file upload control Except for the checkbox value or option being reset, the data of other controls are retained

First of all, if it is format verification or simple data verification, it is better to put it on the client.
Secondly, for your question, you can capture this value in the background when submitting, and then return it

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