Multiple rows selection from an HTML Table.

Results 1 to 2 of 2

Thread: Multiple rows selection from an HTML Table.

  1. #1
    Join Date
    Dec 1969

    Default Multiple rows selection from an HTML Table.

    I would like to write values out to an HTML table, select some of them and retrieve their IDs(Field value) from the Client side. How do I include the checkboxes and retreive the IDs of the selected rows? Also is their a way to check all the checkboxes with one click if I want to select all the rows. <BR><BR>I would very much appreciate your help.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default HTML table is irrelevant...

    ...right?<BR><BR>What does it matter whether the info is shown in an HTML table, with &#060;UL&#062; lists, or just placed randomly all over the browser window?<BR><BR>What you *care* about is getting the values from the CHECKED checkboxes and using them to drive some operation on the posted-to next page, yes?<BR><BR>So far, so good. But then you say:<BR> "...retrieve their IDs(Field value) from the Client side"<BR>Huh? Why do you want to retrieve the IDs on the client??? Don&#039;t you want to send the IDs to the server and then do something based on the selected IDs??? What am I missing?<BR><BR>Anyway: Give all the checkboxes the same name. Put the ID value of each row in as the VALUE= for each checkbox.<BR><BR>And then see here:<BR><BR><BR>As for checking all the checkboxes with a single button click: Sure.<BR><BR>&#060;FORM ...&#062;<BR>&#060;INPUT Type=CheckBox Name="recordID" Value="A3BXY"&#062; John<BR>&#060;INPUT Type=CheckBox Name="recordID" Value="B7XXA"&#062; Harry<BR>...<BR>&#060;INPUT Type=CheckBox Name="recordID" Value="Z9A1D"&#062; John<BR>...<BR>&#060;INPUT Type=Button Value="Check all records" onClick="checkAll( this.form.recordID )&#039;"&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>&#060;SCRIPT Language=JavaScript&#062;<BR>function checkAll( cbgroup )<BR>{<BR> for ( var i = 0; i &#060; cbgroup.length; ++i )<BR> cbgroup[i].checked = true;<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR><BR><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