Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting form values via html:link

 
Gilbert johnson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your JavaScript you'd want to build the URL of the link and add parameters to it. Here's an example:
 
Gilbert johnson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic