Trouble with a checkbox

Results 1 to 2 of 2

Thread: Trouble with a checkbox

  1. #1
    Join Date
    Dec 1969

    Default Trouble with a checkbox

    I have a form with check boxes populated from a db like this<BR>&#060;% If RS("Preferred") = "Yes" Then %&#062;<BR> &#060;input type="checkbox" name="Preferred" checked&#062;<BR> &#060;%Else%&#062; <BR> &#060;input type="checkbox" name="Preferred"&#062;<BR>&#060;% End If %&#062;<BR>Then on the processing page, I have (among the other code)<BR>&#060;%<BR>RS("Preferred") = Request.Form("Preferred") <BR>%&#062;<BR>The value passed to the database is "on"<BR>I have tried many different ways to accomplish getting the correct value passed and nothing is working. The best that I have achieved is if the check box is checked for "Yes" from the db and then the user unchecks it, I am able to get No passed to the db, but if the db populates a No and the user needs to check it as "Yes", it remains no in the db.<BR><BR>MY question: How do I populate the checkbox from the db and then have the value, if changed yes to no or no to yes, reflected in the db.<BR>Thanks,<BR>K.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Trouble with a checkbox

    I gave a long answer about this exact same thing last week. Let me see if I can find it...<BR><BR>[sounds of Bill riffling through dozens of email notes...]<BR><BR>Nope, no luck. Probably answered in this forum and good luck finding it here...Well...maybe...<BR><BR>Ah! Found it by doing a SEARCH for "hidden and checkbox" in the Advanced forum!<BR><BR><BR><BR>Be sure to read the follow-ups! There&#039s a goof in that posting that I correct in a subsequent one.<BR><BR>If that doesn&#039t help you and/or you don&#039t understand it all, ask me again.<BR><BR>[But I&#039m gone rest of this week, so hurry.]<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