aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes submit problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "submit problem" Watch "submit problem" New topic
Author

submit problem

Joshua Cloch
Ranch Hand

Joined: Apr 27, 2006
Posts: 95
Hey guys!

Assume there are more than one submits in a web page,like:

......
<form action="" onsubmit="process()">
<input type="submit" name="a">
<input type="submit" name="b">
</form>

In the method process(),the snippet seems like:

process()
{ if a is chosen
{...}

if b is chosen
{...}

}

How do i know which one is chosen by the user?

Thanks very much.


truehh@hotmail.com
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

I am not sure if it is possible to find out the button used to trigger a form submission, but an alternative approach may be to use something like -



HTH


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Joshua Cloch
Ranch Hand

Joined: Apr 27, 2006
Posts: 95
yes, that is a good idea, thanks.

however, if the submit is a component of web page, it should be ok to determine which is chosen...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: submit problem