...

View Full Version : accessing a checkbox with a dot (.) in its name



scroots
08-15-2004, 09:33 PM
How do i access a checkbox that has a dot (full stop) in its name?

e.g. the checkbox is called br.235

scroots

dumpfi
08-15-2004, 10:28 PM
var checkbox = document.forms['formName']['br.235'];Replace formName with the name of the form.

dumpfi

scroots
08-15-2004, 10:47 PM
thanks i will give it a try.

scroots

glenngv
08-16-2004, 05:18 AM
See my sig for more info on the usefulness of square bracket notation.

scroots
08-17-2004, 02:26 AM
glengv that like is really good i will finish reading it another day.

scroots

Kor
08-17-2004, 10:14 AM
You may use elements reference either

The full reference in a form is:
document.forms[name_or_index].elements[name_or_index]

if name, this will be quoted like
document.forms['form's_name'].elements['element's_name']



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum