472,378 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

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 5664
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Don | last post by:
Can't figure this one out. The "validate" function below checks to make sure the field "names" is not null. "validate" actually calls "isEmpty", which scans the field. Here's the situation. ...
3
by: chirs | last post by:
Hi, I want to put a value in a cookie. The following code does not work. It does not store the box1.value in the cookie. How can I fix it? <input type="text" name="box1"...
3
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like...
4
by: owen | last post by:
I have an <input> box and i want to disable the apostrophe ( ' ) key, so when you press it, no character appears in the input box. All other keys should work ok. I can trap the keypress event...
2
by: Rocio | last post by:
I have a html button created with <input type="submit" id="btnPayNotices" value="Pay Notices" /> now I need to trap the click event at the server side. Yes, this button had to be created with...
2
by: Mara Guida | last post by:
Hi, After I've populated a page with some <INPUT ...> elements I'd like to have access to whatever is written there. The best I've done (which does not work) is: ================ //...
4
by: Steve Swift | last post by:
If it is possible, could someone demonstrate how to make the text entered into an <INPUT TYPE=TEXTfield right-align within the entry field, please? The fields in my form are for numbers, and...
2
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given...
2
by: jp2code | last post by:
I have several input fields on my form, and the form works; however, Visual Studio is showing errors, and I would like to get rid of them. When the form is submitted, it is redirected back to...
1
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.