The reason is we will only be checking certain conditions on the form -- and if those conditions pass, then the rest of the form's inputs are assumed valid (otherwise we'd validate them in the function! The first statement checks to see if the line1.value is NOT "Java Script".
If it is NOT set to "Java Script", the flag is set to false. With the flag set to false, the statement to submit the form is not executed.
Likewise, validating a function's arguments are valid for that function is simply confirming the inputs are correctly formatted.With that said, we’ll start off with the most permissive solution and work our way towards the other end. That’s typically all I ever assume about an email address.If the email the user types in doesn’t follow that structure, odds are they made a typo.I hope this article is useful for all students and beginners.
If you have any suggestion related to this article then please contact me.Once you have an HTML form up and running, you will often want to make sure that all the important fields are filled in.