Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBScript radio button validation

Posted on 2001-06-05
3
Medium Priority
?
2,489 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
kmv earned 200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

609 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