Hidden Element

R

rohit.d.agarwal

Hi All,

I have two types of hidden elements on my form


Type A) the id of the element is static (see below)


<html:hidden name="qtyPlanForm" property="status" styleId="stat01" />


Type B) the id is generated based on the for() loop variable (see
below)


<html:hidden name="qtyPlanForm" property="posmId" value='<%="" +
posmVO.getId().intValue() %>' styleId='<%="pid" + i + "" + j%>'/>


When I do a document.getElementById() for Type A hidden element, I
get
an object, however if I try the same for Type B hidden element I get
null.


Please advise in case I am doing something incorrectly


- RoHiT
 
T

Thomas 'PointedEars' Lahn

I have two types of hidden elements on my form

Type A) the id of the element is static (see below)

<html:hidden name="qtyPlanForm" property="status" styleId="stat01" />

Type B) the id is generated based on the for() loop variable (see
below)

<html:hidden name="qtyPlanForm" property="posmId" value='<%="" +
posmVO.getId().intValue() %>' styleId='<%="pid" + i + "" + j%>'/>

When I do a document.getElementById() for Type A hidden element, I
get an object, however if I try the same for Type B hidden element
I get null.

Please advise in case I am doing something incorrectly

You have posted server-side code for a client-side problem.
Analyzing what your server-side code actually generates for the
client is going to help you in finding your other mistake.


PointedEars
 
Á

Álvaro G. Vicario

(e-mail address removed) escribió:
<html:hidden name="qtyPlanForm" property="status" styleId="stat01" />


Type B) the id is generated based on the for() loop variable (see
below)


<html:hidden name="qtyPlanForm" property="posmId" value='<%="" +
posmVO.getId().intValue() %>' styleId='<%="pid" + i + "" + j%>'/>


When I do a document.getElementById() for Type A hidden element, I
get
an object, however if I try the same for Type B hidden element I get
null.

I'd say you don't have very clear the different between HTML, JavaScript
and ASP.NET. In order to debug client-side scripting you have to look at
the actual HTML generated by your server-side ASP.NET code. The
available tools range from browser's "View Source" to Firebug extension
for Firefox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top