Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing one id from jsp to javascript

 
Naresh Talluri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I had a problem in my struts application, here iam generating one unique id
to define the type of the field(means its textfiled , button....),while
doing this from struts html tags iam checking id by <logic:equal>,iam
checking here but iam not able to pass the type to javascript to validating
can you please let me know how to solve this....

The code is
In JSP:
-------
<logic:equal name="objOptionDTO" property="optionTypeId" value="<%=lResourceBundle.getString("messageform.formfield.hiddeninput")%>">
<%fieldFlag=1;%>
<td>
<logic:iterate id="objOptionData" name="objOptionDTO" property="optionDataDTOList" indexId="num4" type="com.acti.jms.objects.DTO.OptionDataDTO">
<input type="hidden" required="true" id="<bean:write name="objStepsDTO" property="stepId"/>" name="<bean:write name="objStepsDTO" property="stepId"/>" fieldtitle="<%=StringUtil.removeHTMLElement(objStepsDTO.getInstruction())%>" optiontype="<%=lResourceBundle.getString("messageform.formfield.hiddeninput")%>" value="<bean:write name="objOptionData" property="optionData"/>">
</logic:iterate>
</td>
</logic:equal>



Thanks & Regards
Naresh
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You lost me at "not able to pass the type to javascript to validating"...what specifically are you having trouble with? I also do not understand all the attributes that you have on your input tag, but maybe that is unrelated.

- Brent
 
Naresh Talluri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brent Sterling:
You lost me at "not able to pass the type to javascript to validating"...what specifically are you having trouble with? I also do not understand all the attributes that you have on your input tag, but maybe that is unrelated.

- Brent


Hi
Here in this code
value="<%=lResourceBundle.getString("messageform.formfield.hiddeninput")%>
i'll check for the type like textfield (or) dropdown..etc.
In my jsp iam able to show depends on the type.But the problem is
Iam not able to do validation ,because depends on the type (textfield (or) dropdown..etc) iam going to validation , but in javascript iam not
able to get the type, we can do one thing by using the type id what we
got using ="<%=lResourceBundle.getString("messageform.formfield.hiddeninput")%> , but iam not able to pass this id to javascript.
can you please help me on this.

Naresh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic