Maintaining radio buttons

Results 1 to 2 of 2

Thread: Maintaining radio buttons

  1. #1
    Hiram Guest

    Default Maintaining radio buttons

    I have a single form that has radio buttons on it. The submit button does a Post back on itself. How do I make a radio button remember that it was selected when the submit button is hit? I tried to use a VBScript routine to check the value of the form variable and return the work &#039;checked&#039; on a match. But, the routine does not get invoked. Here is how I have the tag coded:<BR><BR>&#060;input type="radio" name="bo_opt" value="4" &#060;%check_bo_opt(8)%&#062;&#062;<BR><BR>and here is the function that I was trying to use:<BR><BR>Function check_bo_opt(optnum)<BR>&#039;******************** ***********************************************<BR >&#039; *<BR>&#039; This is a common called routine to determine which BO option *<BR>&#039; has been selected. If that option was selected, it will return *<BR>&#039; Checked otherwise it will return nothing. *<BR>&#039; *<BR>&#039;*************************************** ****************************<BR> response.write "optnum = " & optnum<BR> if Request.Querystring("BO") = optnum then<BR> check_bo_opt = "checked"<BR> response.write optnum & " was checked"<BR> else<BR> check_bo_opt = ""<BR> end if<BR>End Function<BR><BR>Note that neither one of the response.write lines are hitting.<BR><BR>Ideas anyone??<BR><BR>Thanks in advance.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Maintaining radio buttons

    Use this: <BR>&#060;input type="radio" name="bo_opt" value="4" &#060;%if request.querystring("BO")="4" then response.write "checked" end if%&#062;&#062;<BR><BR>You can probably make it a function if you want since you will need it for each of the radio buttons. I hate functions though.

Posting Permissions

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