how to access a html:hidden element from javascript

I have a hidden element in my form

<html:hidden name="mtrResolutionForm" property="resolutionBean.selectId" />

I would like to assign a value to it in my javascript function

How do I access this hidden element in Javascript?

I tried using the following:

function selVal(ctl)

{

document.all.resolutionBean.selectId=ctl.value;

}

I cant use document.getElementById() since <html:hidden> tag doesnt support id attribute.

Even document.formName.hiddenPropertyname.value doesnt work here

Can somebody help me out with this please?

Thanks!

[624 byte] By [priya020706a] at [2007-11-26 18:06:26]
# 1

View source on the page, you will see that <html:hidden> has generated an <input type="hidden">

If that name has a dot in it, then you will have to use squarebrackets syntax to get a hold of it.

document.all['resolutionBean.selectId'].value

or probably better is to access it through the form

document.formsName['resolutionBean.selectId'].value

evnafetsa at 2007-7-9 5:37:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you so much! It worked. I really appreciate it.
priya020706a at 2007-7-9 5:37:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...