473,756 Members | 5,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Currently I have defined:

-- clip clip --
<form method="post" action="xx"
enctype="applic ation/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********@inva lid.com | Finland | Fax +358 9 229 17800

Jul 23 '05 #1
2 5788
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
1719
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. <input> for "names" first existed in an html file. The test worked just fine there. If the field was filled, the test would pass. If the field was cleared after having been filled, it would fail as it should. The field is then passed, via POST,...
3
2593
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" onblur=document.cookie="user=" + box1.value> Chris
3
13155
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 this, with a flush left margin:
4
10545
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 using "onkeypress=myKeypressHandler()" but, beyond that, I'm stuck. I forget how to detect what key was pressed or how to "null it out". I'm using IE6 and users will be IE5.0 upward ONLY (trust me on this, suffice to say it's not a website but...
2
395
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 plain html, not with asp.net how can i do this ?
2
5329
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: ================ // ==UserScript== // @name AddInput
4
54754
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 they look strange aligned left. -- Steve Swift http://www.ringers.org.uk
2
3385
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 field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
2
3287
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 itself, where it checks the values that were entered. If the default values are set, this is the visitor's first time to access the page. Example: The FirstName field would initially be displayed with "First Name;"
1
5506
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
9462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.