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!

Using only one radio button

Status
Not open for further replies.

NeeNee

Programmer
Apr 2, 2002
97
CA
I am creating an ASP page which generates a dynamic number of records displayed on the page. The user selects the radio button for the record they wish to view and press submit.

It works great when there are more than one radio buttons, but fails when there is only one.

Why is that and is there a work around?

Thanks

Denis
Programmer, Canada
 
I'd ask in the asp forum. And provide some relevant code so they don't have to guess what you are doing and how it is failing.

[!]
-------------------------------------------------------

Mark,

Join me at the new IT Community of the 21st Century: [!][URL unfurl="true"]http://lessthandot.com[/!][/url]

[/!]
 
Sorry, but this is an HTML question. My ASP page is placing only one radio button and I need to know why one radio button is not working.

Denis
Programmer, Canada
 
And how do you define "not working"? Remember, you haven't provided any code and we can't see your page so there's not a lot for us to go on...

[!]
-------------------------------------------------------

Mark,

Join me at the new IT Community of the 21st Century: [!][URL unfurl="true"]http://lessthandot.com[/!][/url]

[/!]
 
I agree with ca8msm, witut seeing your radio code all we can do is guess.

Now whatever you are doing it must be through your ASP, because planting a single radio button on a page and having it sent should work no matter what.

If you show us at least the part of your code that has the radio button we may be able to help. Make sure its the final html and not your ASP code.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Response.write out your form values on the target page for the form and see what your output is. Is the element named properly?

<%
response.write request.form()
response.write request.querystring()
%>

Can't tell you much more without more clarification and code.
 
After much research, the error lied in a few instances where the dynamic asp would only put one radio button on the page because there was only one record, and in the HTML DOM, you can;t have only one radio button. The array length returns a Null and it is impossible to get the value of the button.

This question would have been better posted to the Javascript forum.

Thanks to all.

Denis
Programmer, Canada
 
I don't think that's your issue. You can submit a single radio button. Try below as an asp script.

You didn't say you were using javascript though. Are you gathering the values with a script and submitting, or using the default HTML action?

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form action="" method="post">
<fieldset>
<label for="easylistening">Test Radio Button</label><input type="radio" value="TRUE" name="easylistening" />
<input type="submit" value="Test" />
</fieldset>
</form>
<% response.write request("easylistening") %>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top