File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes regarding images as buttons in the form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "regarding images as buttons in the form" Watch "regarding images as buttons in the form" New topic
Author

regarding images as buttons in the form

NV Krishna
Greenhorn

Joined: Mar 23, 2005
Posts: 14
hi,

i want to put images as buttons. i have to two buttons in the form.one is for submitting the form and another is for open a new window.

my code looks like this...

<form ="submit.html">

<!-- some table with data -->

<input type="image" src="submit.gif"/>
<input type="image" src="graph.gif"/>
</form>

when i click the "submit" button it is submitting the form. but problem is when i click the "graph" button. when i click the "graph" it is submitting the form as well as it is open a new window. which is not right. it should open only new window.

help needed
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
then you need to return false with your onclick.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

"Vamsyn",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
NV Krishna
Greenhorn

Joined: Mar 23, 2005
Posts: 14
Thanks Eric, it's working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding images as buttons in the form
 
Similar Threads
target="_blank" attribute in form tag
Submit Form and Enter Key
Form is not submitting when I use the TAB for navigation
input image and JavaScript
Problem with html image tag inside input tag