...

View Full Version : Urgent help about Checkbox in HTML!!!!



leely
10-02-2004, 10:40 AM
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. :confused:

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>

ReadMe.txt
10-02-2004, 12:24 PM
<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.

leely
10-03-2004, 09:11 AM
i solved that problem!! thank you very much for your suggestion.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum