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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio buttons help with code

Status
Not open for further replies.

croiva25

Technical User
Dec 3, 2003
125
0
0
AU
Ok, I am trying to create 3 radio buttons and to have "Leave" radio button checked by default if the value of D_Approved = NULL.

This code displayes correctly if this is approved or rejected but what behaves funny is that "Leave" radio button is ticked ALL the time and it alllows me to tick one more out of three radio buttons including the ticked one, this is not correct, because the whole idea on which radio buttons work is tha only one of them can be ticked, correct?



Can somebody help me with this please, this is basically the code that is suppose to do what I need it to do, but it has to allow me to select only one radio button and then I need to submit that value. What am i doing wrong here please?







If ISNULL(rsRFQ("D_Approved")) then

Response.Write("<INPUT type=""radio"" id=""D_Approved"" name=""D_Approved"" value=""1"">")

Response.Write("<INPUT type=""radio"" id=""D_Approved"" name=""D_Approved"" value=""0"">")

Response.Write("<INPUT type=""radio"" id=""D_Approved"" name="" D_Approved"" value=""NULL"" checked>")

elseIf rsRFQ("VehicleApproved") <> 0 then

Response.Write("Approved<INPUT type=""hidden"" id=""D_Approved"" name=""D_Approved"" value=""1"">")

Else

Response.Write("Rejected<INPUT type=""hidden"" id=""D_Approved"" name=""D_Approved"" value=""0"">")

End if



Any help appreciated



 
>[tt]Response.Write("<INPUT type=""radio"" id=""D_Approved"" name=""[COLOR=red yellow] [/color]D_Approved"" value=""NULL"" checked>")[/tt]

[tt]Response.Write("<INPUT type=""radio"" id=""D_Approved"" name=[blue]""D_Approved""[/blue] value=""NULL"" checked>")[/tt]


 
also - you shouldn't have more than one element on your page with the same ID. Elements can have the same name or same class as others but IDs should be unique.

tsuji is right about the extra space in your button name. Remove the space and they should work fine.

Tony
[red]_________________________________________________________________[/red]
Webmaster -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top