MCQs > IT & Programming > DHTML > The form tag is defined as follows:
How will you implement the Validate() function that will stop the form from being submitted if the name field on the form is not filled?

DHTML MCQs

The form tag is defined as follows:

<form onsubmit="return Validate()" action="http://www.mysite.com/">

How will you implement the Validate() function that will stop the form from being submitted if the name field on the form is not filled?

Answer

Correct Answer: <script type="text/javascript"> function Validate() { if(document.forms[0].name.value == "") return false; else return true; } </script>

Explanation:

Note: This Question is unanswered, help us to find answer for this one

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it