REQ:

S

solitaire

Hi,

I have a little problem with the internet explorer 5.2 for mac. I have a
checkbox field which name is an array, but then I can't read the field on IE
for MAC. Other browsers don't seem to have problems with it, if I set the
id's of the field the same as the name is. Anybody has a solution?

Code:

<script>

function chklength(field) {

alert(field.length);

}

</script>

<form name="test">

<input type="checkbox" name="testfield[]" id="testfield" value=1> <input
type="checkbox" name="testfield[]" id="testfield" value=2> <input
type="button" onclick="chklength(this.form.testfield)"

</form>

Thanks in advance,

Ben
 
R

Randy Webb

solitaire said:
Hi,

I have a little problem with the internet explorer 5.2 for mac. I have a
checkbox field which name is an array, but then I can't read the field on IE
for MAC. Other browsers don't seem to have problems with it, if I set the
id's of the field the same as the name is. Anybody has a solution?

Code:

<script>

function chklength(field) {

alert(field.length);

}

</script>

<form name="test">

<input type="checkbox" name="testfield[]" id="testfield" value=1> <input
type="checkbox" name="testfield[]" id="testfield" value=2> <input
type="button" onclick="chklength(this.form.testfield)"

</form>

Read the FAQ, and it explains how to access a form element with PHP-like
names.
http://www.jibbering.com/faq/#FAQ4_39

document.forms['formName'].elements['testfield[]'].property;
 

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,951
Messages
2,570,113
Members
46,698
Latest member
alexxx

Latest Threads

Top