• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in html:hidden tag

 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i m sending a hidden variable inside the form.code for hidden variable is
<html:hidden property="fileName" value="<bean:write name="libDocumentInfo1" property="libDocumentName" />"/>

its givin me error :-
org.apache.jasper.JasperException: /jsp/Library/LibraryMainPage.jsp(121,76) equal symbol expected.

form name and property are right and i suppose its synatx error..
can nybody tell me how to correct it??
 
Liju Cherian
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rawat,

You cannot use one struts tag inside another. In the above code u r using <bean:write> within the <html:hidden> tag; i.e. why u r getting such an error.

Try using this instead,



Hope this helps.

Liju
 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
thanx for helping and ur code worked bt with a slight change..

<input type="hidden" name="val" value="<bean:write name="libDocumentInfo1" property="libDocumentName" />" /> (property is nt defined).

now i m trying to retrieve the value in javascript like this..

alert(document.all.val.value); its giving me undefined ??? when i checked the source code "value" atrribute is having value bt nt giving me in javascript.

can u tell me how to get it in javscript???
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try document.myForm.val.value where myForm is the name of the form. In Struts this is the name of the ActionForm used by the action called by the form.

If you only have one form on the page, this will work also:

document.forms[0].val.value
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic