Hi!
I am writing a JSP application using Struts so I am using Struts JSP tags. I have a tag called <html:text> which is equivalent to <input> tag in JSP. I am having trouble getting the name of this field to use it in JavaScript.
I am using a map-backed ActionForm in Struts so my the name (or property as its called in Struts) is dynamic. Therefore I have defined it like this.
<% String propertyName = "value(" + myId + ")"; %>
<html:text property="<%=propertyName%>" readonly="true" size="2" />
My JavaScript looks like this:
function setValue(x){
document.voteForm.propertyName[x].value = value[i++];
document.voteForm.SelectionButton[x].disabled = true;
However document.voteForm.propertyName[x] is null or not an object. Does anyone know what I should call "propertyName[x]" in JavaScript so that it will reference my input field?
I'd appreciate any help.
Thanks, B
I am writing a JSP application using Struts so I am using Struts JSP tags. I have a tag called <html:text> which is equivalent to <input> tag in JSP. I am having trouble getting the name of this field to use it in JavaScript.
I am using a map-backed ActionForm in Struts so my the name (or property as its called in Struts) is dynamic. Therefore I have defined it like this.
<% String propertyName = "value(" + myId + ")"; %>
<html:text property="<%=propertyName%>" readonly="true" size="2" />
My JavaScript looks like this:
function setValue(x){
document.voteForm.propertyName[x].value = value[i++];
document.voteForm.SelectionButton[x].disabled = true;
However document.voteForm.propertyName[x] is null or not an object. Does anyone know what I should call "propertyName[x]" in JavaScript so that it will reference my input field?
I'd appreciate any help.
Thanks, B
Comment