views:

29

answers:

2

My form is like

  <form action="javascript:;" method="post" id="reportForm">
    <input type="text" name="as" maxlength="3" />
    --CODE--
 <html:hidden property="reportid" value="${Scope.reportId}" />
    --code--
   </form>

I can retrieve values from the form in javascript like

    this.form = dojo.byId('reportForm');
    this.as1 = this.form.as;

How can i retrieve the value of the html:hidden tag property.

A: 

There's no html:hidden tag defined in the HTML specification. I don't know dojo but I suppose this syntax will eventually render as <input type="hidden" name="reportid" value="foo" /> and you would retrieve its value the same way as the other input tag: this.form.reportid. You may look with FireBug at the actual DOM.

Darin Dimitrov
think he is using jsp tag's
TuxGeek
A: 

You can use dojo.formToObject and pass the form id or DOM node as the parameter. You can get an object that contains the values of all the form elements.

 var obj = dojo.formToObject("reportForm");
 var id = obj.reportid;
Alex Cheng