Write javascript code for the form that appears in the image below. You are expected to add validation to the name field (the name field cannot be blank), email field, and radio button selection. The HTML code is given below. Insert Javascript code in the <head> area of the file and paste one screenshot of the validation you have written
<form name = "frmNews" action = "application.aspx" method = "post" onsubmit = "return check(this)">
<h2>Newsletter Application</h2>
<p>To get our newsletters in your inbox, give us a few details
about yourself.<br />Then tell us why you are interested in this topic in
100 words or less.</p>
<table>
<tr>
<td class = "frmDetails">Name:</td>
<td><input type = "text" name = "txtName" size = "20" /></td>
</tr>
<tr>
<td class = "frmDetails">Email:</td>
<td><input type = "text" name = "txtEmail" size = "20" /></td>
</tr>
<tr>
<td class = "frmDetails">Topic:</td>
<td>
<input type = "radio" name = "radNewsletter" value = "" />Health and Wellness<br />
<input type = "radio" name = "radNewsletter" value = "" />Creative Writing<br />
<input type = "radio" name = "radNewsletter" value = ""/>Gardening
<br />
</td>
</tr>
<tr>
<td class = "frmDetails">I am interested in this topic because:</td>
<td>
<textarea name = "txtTopic" cols = "40" rows = "5"/>
</textarea>
</td>
</tr>
<tr>
<td class ="frmDetails"></td>
<td><input type = "submit" value = "Submit" /></td>
</tr>
</table>
</form>
Alt text : an HTML form
Type your response here:
Ashley P.
What is the reason of adding the line "return false", in this case?11/17/19