How to access struts 2 given tags using javascript? I tried to access the following tag <s:url id="getTsk" action="axnTskPlnr" method="updtTsk"></s:url> This is my javascript statement to access the above tag document.getElementById('getTsk') But it was giving "Object required" script error. Actually i wanted to dynamically change the method attribute.
It would be greatly appreciated if any one can give a pointer to the solution.
Harimohan [ December 24, 2008: Message edited by: InSilico ]
All the <s:url...> tag does is create a URL--it doesn't render anything. The "id" attribute specifies the variable n which the URL will be stored--this is on the *server* side.
Also, the JavaRanch rules state that you must use a real name: http://www.javaranch.com/name.jsp [ December 24, 2008: Message edited by: David Newton ]
paddy Mahadeva Iyer
Ranch Hand
Joined: Feb 10, 2007
Posts: 63
posted
0
Hi,
I think that would not work. Since the will not render anything in the client side. May be if you want to do a get element by Id you cant try declaring the then access it in a hidden tag . Then in your javascript call the id of the hidden tag.
I think that should work and you should get the actual url.