By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,620 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

REQ:

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
solitaire wrote:
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;

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.