Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 December 10th, 2007, 07:39 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default validation in radio buttons


can i apply validation controls to radio

button.

i have two radio buttons which are in

same group and required user info either

yes or no.

i need user must select in one of two.

as lots of radio buttons combinations

are there in my form so i am not looking

into coding at first.

thanks......
__________________
thanks......
 
Old December 10th, 2007, 09:43 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Why not just set a default option to selected?? This would prevent the user from not selecting at least 1 one option from each group.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 11th, 2007, 03:00 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

okay smart answer. i was thinking how to put Validations in it.
:)

thanks......
 
Old December 11th, 2007, 09:42 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

There are no built in Validation Controls that will validate Radio Buttons. You can do one of two things:

Write a JavaScript that will check to see if any of the Radio Buttons have been selected or write server side code that will do the same thing.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 11th, 2007, 09:50 AM
Authorized User
 
Join Date: Sep 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

either make one of them as default or put a client side validation through javascript if you dont want to go for server side validation.

 
Old December 11th, 2007, 11:15 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Write javascript is also one option. Thanks

thanks......





Similar Threads
Thread Thread Starter Forum Replies Last Post
Radio Buttons and Calculations Student101 Java Basics 4 June 21st, 2009 11:02 AM
Validation Radio Buttons jonsey Classic ASP Professional 1 June 6th, 2007 11:48 PM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
How to use the radio buttons? ben_VB VB.NET 2002/2003 Basics 1 January 18th, 2005 12:29 PM





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