p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > JavaScript > Javascript How-To
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 29th, 2009, 12:20 PM
Authorized User
Points: 81, Level: 1
Points: 81, Level: 1 Points: 81, Level: 1 Points: 81, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Jun 2007
Location: , , .
Posts: 16
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()" />
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 30th, 2009, 08:28 AM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 12:14 PM
handling multiple record sets Phrozt Classic ASP Professional 1 October 12th, 2006 05: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 07:33 AM
Getting around empty data sets evo187 ASP.NET 1.1 2 April 13th, 2005 07:01 AM



All times are GMT -4. The time now is 11:18 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc