Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urgent help about Checkbox in HTML!!!!

    Hi,

    I have a question about checkbox in IE data binding. I am using IE data binding to display a table in HTML. One of the columns in my table is checkbox. The table is inside a form. After submitting the form, my script want to know which rows have been selected by checking the checkbox in the row.

    In regular HTML, this can be easily achieved by sending name-value pair using the following code.
    <input type="checkbox" value="row_id">

    However, in IE data binding, the value of a checkbox is only "on" or "off". After submitting the form, only checked checkbox are submitted, and its value is always "on". I can only know the number of rows checked, but have no way to know which rows have been checked. My code is attached below.

    I have struggled on this problem for quite a while..

    Can anyone help me?

    Thank you.

    leely

    <form action="script.pl" method="post" name="MyForm" id="MyForm">

    <table DATASRC="#dataBindId">
    <THEAD>
    <th><div>Check Box</div></th>
    <th><input type="Button" value="ID" onClick="document.all.dataBindId.sort='ID';dataBindId.Reset();"></th>
    <Th><input type="Button" value="col1" onClick="document.all.dataBindId.sort='col1';dataBindId.Reset();"></Th>
    </thead>

    <TBODY>
    <td><div><input type="checkbox" name="id_checked" value="yes"></div></td>
    <td><div DATAFLD="ID"></div></a></td>
    <td><div DATAFLD="Col1"></div></a></td>
    </tbody>

    <input type="submit" />
    </form>
    Last edited by leely; 10-02-2004 at 10:41 AM. Reason: title is wrong

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <input type="hidden" name="id_checked" value="no">
    <input type="checkbox" name="id_checked" value="yes">

    Et viola. You must keep the source order the same, with the hidden field before each checkbox.
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #3
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thank you very much! ReadMe.txt

    i solved that problem!! thank you very much for your suggestion.


  •  

    Posting Permissions

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