Radio Button Question

Results 1 to 2 of 2

Thread: Radio Button Question

  1. #1
    Join Date
    Dec 1969

    Default Radio Button Question

    I have a program where the user fills out a personal profile using a screen with a lot of different sets of radio buttons/ or checkboxes. The answer is stored in a database. I want to be able to pull the users records and then populate the radio buttons / checkboxes on a screen based on the stored answers.<BR><BR>The question is how to automatically change the values of a radio button / checkbox using code and variables?<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default CHECKED

    &nbsp;<BR>&#060;INPUT Type=Radio Name="MaritalStatus" Value="M" <BR> &#060;% If RS("maritalStatus") = "M" Then Response.Write "CHECKED" %&#062; &#062; Married<BR>&#060;INPUT Type=Radio Name="MaritalStatus" Value="S" <BR> &#060;% If RS("maritalStatus") = "S" Then Response.Write "CHECKED" %&#062; &#062; Single<BR>&#060;INPUT Type=Radio Name="MaritalStatus" Value="D" <BR> &#060;% If RS("maritalStatus") = "D" Then Response.Write "CHECKED" %&#062; &#062; Divorced<BR>&#060;INPUT Type=Radio Name="MaritalStatus" Value="U" <BR> &#060;% If RS("maritalStatus") = "U" Then Response.Write "CHECKED" %&#062; &#062; Unknown<BR><BR>***********<BR><BR>Now, you *could* do that more efficiently, codewise, perhaps starting from an array and building the radio buttons in ASP code. But the above is about as efficient, performancewise, as you will get.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts