wood burning stoves*
The moose likes Struts and the fly likes Passing one id from jsp to javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Passing one id from jsp to javascript" Watch "Passing one id from jsp to javascript" New topic
Author

Passing one id from jsp to javascript

Naresh Talluri
Ranch Hand

Joined: Oct 12, 2007
Posts: 115
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

Joined: Feb 08, 2006
Posts: 948
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

Joined: Oct 12, 2007
Posts: 115
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
 
Consider Paul's rocket mass heater.
 
subject: Passing one id from jsp to javascript
 
Similar Threads
Display an ArrayList within an ArrayList
Issue in populating field in parent window
how to apply continue statement in struts logic:iterate tag
Performance issue in JSP
Iterate Hashmap through struts