Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding images as buttons in the form

 
NV Krishna
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then you need to return false with your onclick.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
NV Krishna
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric, it's working.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic