This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Form Submit, as link outside Form Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Form Submit, as link outside Form Tag" Watch "Form Submit, as link outside Form Tag" New topic
Author

Form Submit, as link outside Form Tag

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16617

Is there a way to create a link, that will be the submit for a form, but the link is not inside the form tags.
Meaning, I have a Table with two columns. In the left column I have links, the links say "Save" and "Cancel". In the right column I have a form. Instead of having to use a Submit and Cancel button inside the form on the right column, I want the links in the left column to handle the job.
Thanks
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50677


[ April 18, 2004: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16617

Thanks Bear. You can also name the Form correct. This is in theory if I have two forms on the same page.
Mark
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23621

Bear's example does use a named form (theForm.)
If you want to do any processing first, like set some hidden value, you could use a javascript function. For example,


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16617

Thanks guys.
Mark
 
 
subject: Form Submit, as link outside Form Tag
 
Threads others viewed
Can I find out the originating link to my jsp using javascript?
Checking for nulls in JSP if user bypasses struts
passing parameters in spring
Design help
How to submit a div alone ?
developer file tools