Dynamic checkbox ignored when posting

M

Mark

Hi - when I add (dynamically) a row to a table, which includes a
checkbox, I want the value of the checkbox to be posted along with the
other controls already on the form when the form is submitted.

I can get this to work no problem on IE6, but in NN7, although the
checkbox is added to my screen, when posted (submit on form), the
checkbox is ignored. The checkbox is added within the form.

Any ideas?

function addRowaddFact (cb_strval) {
var table;
table = document.getElementById('tbladdFact');
if (table && table.insertRow) {
var row = table.insertRow(table.rows.length);
var cell = row.insertCell(0);

cell.innerHTML = '<input checked
type="checkbox" name="cbaddFact" value="' + cb_strval +
'"\/>'+cb_strval;
}
}
 
L

lallous

Hello,

Are the checkboxes being added to the form being posted?

If they still don't get posted, try to change the posting mechanism...use a
hidden variable that will encode all the needed values whenever you post the
form, then the server page will read its info from this hidden field instead
of the checkboxes.
 
K

kaeli

Hi - when I add (dynamically) a row to a table, which includes a
checkbox, I want the value of the checkbox to be posted along with the
other controls already on the form when the form is submitted.

I can get this to work no problem on IE6, but in NN7, although the
checkbox is added to my screen, when posted (submit on form), the
checkbox is ignored. The checkbox is added within the form.

I don't think NN likes the innerHTML.
Use createElement, appendChild and real DOM methods.
http://www.mozilla.org/docs/dom/domref/dom_el_ref.html#1021544


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top