Check All Command Button

Results 1 to 3 of 3

Thread: Check All Command Button

  1. #1
    WS Guest

    Default Check All Command Button

    I have a check box displayed in a table per each record returned from a recordset. I am trying to code for a cmd button that will select all/deselect all checkboxes . Any suggestions?<BR>Thanks,<BR>WS

  2. #2
    Franco Guest

    Default This is what HTML was not designed for

    Yo<BR><BR>One way to do this would be to have the command button re-reference the same page with a boolean to indicate on or off and whether everything should be switrched off.<BR><BR>As John Winston Lennon might be saying were he not dead, imagine 2 itty-bitty buttons:<BR><BR>&#060;input type=button value="buy chumbawamba&#039s latest cd it rocks" onclick="return TurnAllBoxesOn()&#062;<BR>&#060;input type=button value="More Yanks than a circle jerk" onclick="return TurnAllBoxesOff()&#062;<BR><BR>Next, imagine some jscript client-side code.<BR><BR>function TurnAllBoxesOn() {<BR>location.href="CurrentPage.asp?Checkboxes=All On<BR>}<BR><BR>function TurnAllBoxesOff() {<BR>location.href="CurrentPage.asp?Checkboxes=All Off<BR>}<BR><BR>Still with me? Good. Time for some ASP. Up top somewhere, put in the code:<BR>&#060;%<BR>Select Case Request.QueryString("CheckBoxes")<BR>Case "AllOn"<BR>strCheckBoxValue="CHECKED"<BR>Case "AllOff"<BR>strCheckBoxValue=""<BR>Case ""<BR>&#039Put your default checkbox value here eg<BR>strCheckBoxValue=""<BR>End Select<BR>%&#062;<BR><BR>Now, finally, my friend, and you are my friend, I ask you to mix up some HTML and ASP, Delia Smith-stylee. Amend each checkbox so it looks like this:<BR><BR>&#060;INPUT id=UpToYou name=UpToYou type=checkbox &#060;%=strCheckBoxValue%&#062;&#062;<BR><BR>Th at should do the trick. Paul Daniels would be EVER so proud.<BR><BR>F.<BR><BR><BR>

  3. #3
    WS Guest

    Default RE: This is what HTML was not designed for

    Excellent, Thanks

Posting Permissions

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