View Full Version : assign value to hidden field

08-28-2004, 06:48 PM
Hi guys,

short javascript question:

how can I assign a new value to a hidden field named 'properties[age]'? Both
form.properties[age].value = value; and form.properties.age.value = value; don't seem to work ...

Any ideas on how to do this?

Thanx, Michiel

08-28-2004, 06:56 PM
This should work:
document.forms['formName']['properties[age]'].value = ...Replace formName with the name of your form.

However, i'm not sure if the hidden field should not be named properties["age"] instead.


08-30-2004, 06:34 AM
Michiel, see my sig for more info of th Square Bracket Notation that dumpfi used.

08-30-2004, 08:00 AM

thanx for that info .. I didn't know about that possibility at all! Anyways, I've added the page to my bookmarks ;)

Cheers, Michiel

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum