Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2009, 11:20 AM
Authorized User
 
Join Date: Jun 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default validate multiple sets of data on a form

I have a form. On this form are survey questions...for this example we will say there are 4 questions.

So I have 4 sets of radio buttons
named: response1, response2, response3, response4


I dont care which answer they choose, I just want to make sure they choose an answer for each set of radio buttons.

I can validate them one set at a time, but that is tedious....can anyone help me out how i can check to see if each set has a button selected/checked?

form example:
<form name="editForm">
<input type="radio" name="response1" value="1" />1<br />
<input type="radio" name="response1" value="2" />2<br />
<input type="radio" name="response1" value="3" />3<br />
<input type="radio" name="response1" value="4" />4<br /><br />

<input type="radio" name="response2" value="1" />1<br />
<input type="radio" name="response2" value="2" />2<br />
<input type="radio" name="response2" value="3" />3<br />
<input type="radio" name="response2" value="4" />4<br /><br />

<input type="radio" name="response3" value="1" />1<br />
<input type="radio" name="response3" value="2" />2<br />
<input type="radio" name="response3" value="3" />3<br />
<input type="radio" name="response3" value="4" />4<br /><br />

<input type="radio" name="response4" value="1" />1<br />
<input type="radio" name="response4" value="2" />2<br />
<input type="radio" name="response4" value="3" />3<br />
<input type="radio" name="response4" value="4" />4<br /><br />

<input type="button" name="Submit" value="Submit" onclick="test()" />
 
Old October 30th, 2009, 07:28 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following examples which might help you:

http://javascript.about.com/library/blradio1.htm
http://www.eggheadcafe.com/community...o-buttons.aspx
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Union of Two data Sets tusharnarayan SQL Language 7 November 4th, 2008 05:23 PM
issue with data sets kaliaparijat ASP.NET 2.0 Professional 1 June 22nd, 2008 11:14 AM
handling multiple record sets Phrozt Classic ASP Professional 1 October 12th, 2006 04:33 AM
Chapter 12 - Multiple Active Result Sets mdrake BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 9 May 13th, 2006 06:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.