|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
HTML
DETAILS
Question: How can I require that fields be filled in, or filled in correctly?
Answer: Have the server-side (e.g., CGI) program that processes the form submission send an error message if the field is not filled in properly. Ideally, this error message should include a copy of the original form with the original (incomplete or incorrect) data filled in as the default values for the form fields. The Perl CGI.pm module provides helpful mechanisms for returning partially completed forms to the user. In addition, you could use JavaScript in the form's ONSUBMIT attribute to check the form data. If JavaScript support is enabled, then the ONSUBMIT event handler can inform the user of the problem and return false to prevent the form from being submitted. Note that the server-side program should not rely upon the checking done by the client-side script.
|
|
|
Category |
HTML Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8655 users |
Added on |
9/14/2014 |
Views |
67628 |
Rate it! |
|
|
Question:
How can I require that fields be filled in, or filled in correctly?
Answer:
Have the server-side (e.g., CGI) program that processes the form submission send an error message if the field is not filled in properly. Ideally, this error message should include a copy of the original form with the original (incomplete or incorrect) data filled in as the default values for the form fields. The Perl CGI.pm module provides helpful mechanisms for returning partially completed forms to the user. In addition, you could use JavaScript in the form's ONSUBMIT attribute to check the form data. If JavaScript support is enabled, then the ONSUBMIT event handler can inform the user of the problem and return false to prevent the form from being submitted. Note that the server-side program should not rely upon the checking done by the client-side script. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How can I allow file uploads to my web site?
|
View Answer
|
|
Can I prevent a form from being submitted again?
|
View Answer
|
|
How do I get form data emailed to me?
|
View Answer
|
|
How can I specify colors?
|
View Answer
|
|
How do I eliminate the space around/between my images?
|
View Answer
|
|
How do I eliminate the blue border around linked images?
|
View Answer
|
|
What are HTML Lists?
|
View Answer
|
|
Posting Copy and Paste HTML
|
View Answer
|
|
Should I put quotes around attribute values?
|
View Answer
|
|
How can I show HTML examples without them being interpreted as part of my document?
|
View Answer
|
|
How can I have two sets of links with different colors?
|
View Answer
|
|
How do I create a link that sends me email?
|
View Answer
|
|
Why is there extra space before or after my table?
|
View Answer
|
|
Why doesn't <TABLE WIDTH="100%"> use the full browser width?
|
View Answer
|
|
Can I use percentage values for <TD WIDTH=...>?
|
View Answer
|
|
How can I use forms for pull-down navigation menus?
|
View Answer
|
|
How can I use tables to structure forms?
|
View Answer
|
|
How can I eliminate the extra space after a </form> tag?
|
View Answer
|
|
How do I set the focus to the first form field?
|
View Answer
|
|
How do I make a form so it can be submitted by hitting ENTER?
|
View Answer
|