radio button

Results 1 to 2 of 2

Thread: radio button

  1. #1
    prashanth Guest

    Default radio button

    HI ,<BR><BR>I have a table with 3 rows. the first column is a radio button. The table is populated dynamically from the results of the query and using the while & for loops.<BR><BR>when i check the first radio button(first row) the contents of that first row has to be picked by the form ( obviously hidden) and sent to the next page.<BR>Similarly when i select row the second row contents have to be sent. <BR><BR>can you help me?

  2. #2
    Join Date
    Dec 1969

    Default one very easy way...

    ...would be to send *ALL* the data to the next page, and let *it* pick which set of data to use:<BR><BR>&#060;INPUT Type=Radio Name="PickOne" Value="1"<BR>&#060;INPUT Type=Hidden Name="UserName_1" Value="Fred Flinstone"&#062;<BR>&#060;INPUT Type=Hidden Name="UserEMail_1" Value=""&#062;<BR><BR>&#060;INPUT Type=Radio Name="PickOne" Value="2"<BR>&#060;INPUT Type=Hidden Name="UserName_2" Value="Wilma Flinstone"&#062;<BR>&#060;INPUT Type=Hidden Name="UserEMail_2" Value=""&#062;<BR><BR>&#060;INPUT Type=Radio Name="PickOne" Value="3"<BR>&#060;INPUT Type=Hidden Name="UserName_3" Value="Barney Rubble"&#062;<BR>&#060;INPUT Type=Hidden Name="UserEMail_3" Value=""&#062;<BR><BR>********** ****<BR><BR>Then, on the next page:<BR><BR>&#060;%<BR>whichUser = Request.Form("PickOne")<BR>userName = Request.Form("UserName_" & whichUser)<BR>userEMail = Request.Form("UserEMail_" & whichUser)<BR>%&#062;<BR><BR>See how easy? All 3 user names and emails get sent to the next page, but the radio button value tells that page which to use and the others are ignored.<BR><BR>There are other ways to do this, but they involve using JavaScript in the browser and are more complex. Why bother?<BR><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