Hi all,
How do I access a
struts <html:hidden> tag in the javascript and
disable it when a user clicks on a particular row of data. Below is the
JSP and javascript. The problem I am facing is that the hidden tag is
indexed and i need the syntax for accessing it. I have tried
document.form.getElementById('schds[0].price').disabled = true;
but it doesnt work. Please let me know if you have any suggestions.
<script>
function highlight(curItem, index)
{
if(curItem.className == "normal")
{
curItem.className = "highlight";
// access the html:hidden field here and set its disabled=false
}
else
{
curItem.className = "normal";
// access the html:hidden field here and set its disabled=true
}
}
</script>
<logic:iterate id="stocks" name="stocks" type="someVO" indexId="ctr">
<TR Class="normal" id=<%=stocks.getprice()%> STYLE="height:16px;" onchange='<%="highlight(this, " + ctr + ")"%>'
<html:hidden name="schds" indexed="true" value="<%=stocks.getPrice()%>"
property="price" />
<TD><%=stocks.getReportName()%></TD>
</TR>
</logic:iterate>