Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Buttons Null When Submitted

Status
Not open for further replies.

derrickorama

Programmer
Jun 30, 2006
25
US
On a contact form for a client of mine, there are radio selections that do not have a default selection. When the form is submitted, without selecting one, the variable is not passed to the ASP page... it is ignored. Is there a way to get the radio input, even if it is null? Right now I'm using the POST method on the form and Request.Form command for the inputs. Any ideas?

Thanks,
Derrick
 
Checkboxes behave the same way.

If they are selected then you get the value, if not you don't.
 
Use the IsEmpty function. Somthing like this...

Code:
<%
    If IsEmpty(Request.Form("[!]RadioButtonName[/!]")) Then
        ' Radio button was not selected
    End If
%>

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top