473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 5744
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>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.