File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Forms containing links Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Forms containing links" Watch "Forms containing links" New topic

Forms containing links

Tom Panahil

Joined: May 31, 2006
Posts: 2
I want to pass a bunch of parameters with a request, and currently use links, but do not like exposing all the parameters.

I want to use a form with hidden input fields, but still want to have the link, and have it look/act like a link, just have it do the form submit method only.

Any thoughts?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60046

Moved to the HTML/Javascript forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60046

Use javascript to submit the hidden form upon clicking the link:

Be sure that the form method is POST.
[ May 31, 2006: Message edited by: Bear Bibeault ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
All of that hidden information is still game for people to see and change so do not think it is any safer.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Forms containing links
Similar Threads
How to pass more than 1 parameters into the sevlet???
Form Submit, as link outside Form Tag
Clickable links and request params in a dataTable
Question on Links using struts
using a href link to pass parameters to servlet.