aspose file tools*
The moose likes Struts and the fly likes passing form parameters such us textfield values using url tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing form parameters such us textfield values using url tag" Watch "passing form parameters such us textfield values using url tag" New topic
Author

passing form parameters such us textfield values using url tag

Ankur Premi
Greenhorn

Joined: Aug 07, 2010
Posts: 17
Help me to pass form parameters such us textfield values using url tag....

How to populate param tag using javascript ?



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why wouldn't you just use hidden fields?
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

If you view the source of the html that is generated by the Struts tags you will see that the href in the anchor tag is filled in by what is specified in the referenced Struts url tag. So what you could do is append your text field information onto the anchor tags href.

Here is a simple example:
Ankur Premi
Greenhorn

Joined: Aug 07, 2010
Posts: 17
actually need to pass all the values stated in my program to the action class. and i have to send the value of the textfield to the action class.

when i try to pass the values through url...i am not able to pass the textfield value

and when i try to pass the value of the textfield ... i am not able to pass the values through url...

i tried using hidden form field for passing the the value of textfield but it did not worked for me..
Ankur Premi
Greenhorn

Joined: Aug 07, 2010
Posts: 17
i have changed the code as...


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Ankur Premi wrote:i tried using hidden form field for passing the the value of textfield but it did not worked for me..

Please see ItDoesntWorkIsUseless.

If it didn't work, chances are you did something wrong: it's a single form with your textfield and all the hidden ones you're trying to send in the URL now. What happened? How did you implement it?

I don't really understand the onclick handler you posted above. Also please take care when posting wide source; it makes reading messages rather difficult, as it forces horizontal scrolling.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

David is right. Although you could pass the text field information as a parameter, the right thing to do would be to figure out why your not getting the field value back.
Ankur Premi
Greenhorn

Joined: Aug 07, 2010
Posts: 17
Thank you everyone who helped me. I was able to pass the textfield value using javascript





By calling this function onclick of href.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing form parameters such us textfield values using url tag