Solved

VBScript radio button validation

Posted on 2001-06-05
3
2,377 Views
Last Modified: 2008-02-01
Hi all,

I have a group of radio buttons. How do I check whether any of those radio buttons is not checked. The validation have to be done using VBscript.

Thanks in advance.
0
Comment
Question by:choroque
3 Comments
 
LVL 2

Accepted Solution

by:
kmv earned 50 total points
ID: 6158838
Is it server-side checking or client-side?
Server-side.
When you submit form to server all its parameters are sent to script.
If user didn't check any radio button you get empty value of parameter with same name as your radio button name.

E.g.
HTML:

<input type="radio" name="gender" value="male">Male
<input type="radio" name="gender" value="female">Female


Server script:
<%if request.Form("gender")="" then
'place your code here
end if
%>

or
<%if isEmpty(request.Form("gender")) then
'place your code here
end if
%>
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6158958
choroque,

if you have 10 radio button,

Name all radio button same name, but different value

Sample:

<input type="checkbox" name="C1" value="ON1">
<input type="checkbox" name="C1" value="ON2">
<input type="checkbox" name="C1" value="ON3">

asp script:
i = 1
For Each Item in Request.Form("C1")
   IF Item.Value = "" Then Response.Write("C1.value = On" &i&" is no checked")
   i = i + 1
Next

Regards,
Wee Siong
0
 
LVL 1

Author Comment

by:choroque
ID: 6162066
Oppss... I guess I forgot to mention, the validation have to be a client-side script..
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now