*
The moose likes Struts and the fly likes html:hidden, property & javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:hidden, property & javascript" Watch "html:hidden, property & javascript" New topic
Author

html:hidden, property & javascript

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
i want to assign a value to property of a bean. The value is actually in a javascript variable....

function submitId(somevalue)
{
document.getElementById("set_me").value=somevalue;
document.forms[0].submit();

}



<html:form action="TaskDetails">
<input type="hidden" id="set_me" value="10" />
</html:form>


trouble is

<input type do not have "property" tag and if I use
html:hidden there is no way to get the script variable....


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
how about styleId ?
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Thanks for responding buddy..... i did something of this kind...

http://husted.com/struts/tips/002.html
and hopefully it worked...
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I am not sure how the linked article fits in with your issue. Did you give styleId a try? The Struts html tags have a property named styleId that renders the html id attribute which is what you would need to use with document.getElementById.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:hidden, property & javascript
 
Similar Threads
struts taglib problem!
Struts wizard + JavaScript validation
Re: using javascript in jsp's
bean value persists on clicking back
html:form pointing to some outside url ?