469,572 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Form submission prevention with <input type=image onclick=..>

Currently I have defined:

-- clip clip --
<form method="post" action="xx"
enctype="application/x-www-form-urlencoded">

[stuff]

<input type="image" name="Function 1" src="image1.gif" border="0"
title="1">
<input type="image" name="Function 2" src="image2.gif" border="0"
title="2">

[and so on]

</form>
-- clip clip --

So, it's a basic toolbar with images. Now, a need has arisen to
make available functionality, through a clickable image, that would
open a pop-up window (with a form, which will submit the window.opener's
form) without submitting the original form [Until an option is selected in
the popup].

How exactly should I go about this? the basic <input type=image> will
submit the form when clicked even if the onclick is defined.

I know of the onsubmit parameter in the <form> tag, but how would I
go about stopping the submission when this particular image is clicked?

If it's possible to make this happen with a non-input tag, that'll be
acceptable too.

The "supported" browser is IE5.5+

--
Kimmo R. M. Hovi, Software| Mäkelänkatu 91 | Tel +358 9 229 17829
Engineer - Kronodoc Oy | 00600 Helsinki | GSM +358 40 767 8610
ki********@invalid.com | Finland | Fax +358 9 229 17800

Jul 23 '05 #1
2 5557
On Wed, 14 Apr 2004 17:15:22 +0300, Kimmo R. M. Hovi wrote:
So, it's a basic toolbar with images. Now, a need has arisen to
make available functionality, through a clickable image, that would
open a pop-up window (with a form, which will submit the window.opener's
form) without submitting the original form [Until an option is selected in
the popup].

How exactly should I go about this? the basic <input type=image> will
submit the form when clicked even if the onclick is defined.

I know of the onsubmit parameter in the <form> tag, but how would I
go about stopping the submission when this particular image is clicked?

If it's possible to make this happen with a non-input tag, that'll be
acceptable too.


I'm sure I'm missing something here, but is there any reason you can't use
<a href="..."><img src="..." ... /></a> ?

Regards,
Henk Burgstra

Jul 23 '05 #2
Or <img src="yadda.jpg" onClick="window.open('...')"> ..?
--
William Morris
Semster, Seamlyne reProductions
Visit our website, http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!
"Henk Burgstra" <eg****@xs4all.nl> wrote in message
news:pa***************************@xs4all.nl...
On Wed, 14 Apr 2004 17:15:22 +0300, Kimmo R. M. Hovi wrote:
So, it's a basic toolbar with images. Now, a need has arisen to
make available functionality, through a clickable image, that would
open a pop-up window (with a form, which will submit the window.opener's
form) without submitting the original form [Until an option is selected in the popup].

How exactly should I go about this? the basic <input type=image> will
submit the form when clicked even if the onclick is defined.

I know of the onsubmit parameter in the <form> tag, but how would I
go about stopping the submission when this particular image is clicked?

If it's possible to make this happen with a non-input tag, that'll be
acceptable too.


I'm sure I'm missing something here, but is there any reason you can't use
<a href="..."><img src="..." ... /></a> ?

Regards,
Henk Burgstra

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Don | last post: by
4 posts views Thread by Steve Swift | last post: by
2 posts views Thread by Richard Maher | last post: by
2 posts views Thread by jp2code | last post: by
1 post views Thread by test9991014 | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.