validate fields when a dynamic checkbox is selected

B

bobby1041

Hi All!

I am trying to make several fields in a HTML form validated, but only
when a dynamic checkbox is selected. I am not sure how to do this.

Here is a snippet of the dynamic checkbox code:
<%
Set RSLIST = Server.CreateObject("ADODB.Recordset")
SQLLIST = "SELECT * FROM Newsletters ORDER BY Newsletter_Name"
RSLIST.Open SQLLIST, Conn, 1, 3
%>
<%Do While Not RSLIST.EOF%>
<input type="checkbox" name="Newsletters"
value="<%=RSLIST("ID")%>"><%=RSLIST("Newsletter_Name")%>

I would like to make three fields (company, phone_work, license)
mandatory when one of the "ID" (i.e. ID 2) is checked.

Please advise. Thanks for any assistance.
 
B

Bullschmidt

Javascript Field Validations -- Client Side Scripting by Nannette
Thacker - 8/19/1999
http://www.shiningstar.net/articles/articles/javascript/javascriptvalida
tions.asp?ID=AW

Form Validation Using Javascript - 9/19/1998
http://www.4guysfromrolla.com/webtech/091998-1.shtml
Good tips such as saving JavaScript functions in a file called
DataValidation.js and including this in pages that need this.
JavaScript functions.

WebDaily: Your daily source for Web Technology Tips and Tricks! -
10/27/1998
http://www.4guysfromrolla.com/webtech/102798-1.shtml
Just checks if fields filled in.

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top