File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Getting form values via html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting form values via html:link" Watch "Getting form values via html:link" New topic
Author

Getting form values via html:link

Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
Hey Guys

I need some urgent help. I thought it was a simple issue and never thought in detail about it and when I started to code, I'm STUCK.

I have a form which contains text fields and drop down list and a submit button.

On the same page, there is a printer friendly link and if the user clicks on this link, a new window will open and a printer friendly version of the page will be shown.

So instead of the dropdown list or text fields, the values entered by the user will be shown as static text.

Now my problem is how do I get those form values. Since its a link, the form is not submitted and I dont have access to the values entered by the user before he clicked the printer friendly screen.

What is the solution to it.
Thanks for your inputs
Dileep Kamath
Greenhorn

Joined: Jul 15, 2006
Posts: 19
I'm afraid form submission is the only way you can save the content on the screen.

To have the user experience be the same you could have a print button styled to look like a link.

Another option could be to use javascript to change the link attributes on change of the content on the screen. I haven't tried but you can give it a shot.
[ July 21, 2006: Message edited by: Dileep Kamath ]
Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
thanks for the input dileep !

You were mentioning about using javascript - Can you explain that a little more in detail....
thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In your JavaScript you'd want to build the URL of the link and add parameters to it. Here's an example:


Merrill
Consultant, Sima Solutions
Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
hey merill

Thats a very interesting piece of code. Thanks a lot - I'm sure it will work - I'll try that out tomorrow at work and let you know.

Thanks a MILLION
appreciate your help a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting form values via html:link