Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

problem in html:hidden tag

 
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??
 
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???
 
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
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic