Harvey K.

asked • 06/11/18

I need help on my computer programming assignment.

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:

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.