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

K

Kimmo R. M. Hovi

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+
 
H

Henk Burgstra

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
 
W

William Morris

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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top