hi,
i want to use an image on my submit button, but im having problems with it, as it does not execute the javascript associated with it.
For example, this is my exit button:
<input type="image" name="exit" src="images/exit.jpg" border="0" onClick="window.close();">
When, i click on in, a window pops-up asking confirmation to exit or not, even if i say no, it goes back to the previously opened page. im having the same problem with other submit buttons when i use <input type=image>
Is there any other way i can put an image using <input type=submit> itself?
Please help.
15 13153
You could try using an image as the background for a submit button. It may not look the same as an actual <intput type=image> but it would probably be close. The problem you described is typical of javascript to close a window or do other things, it leaves control to the user and not the javascript otherwise webpages could take control of your web surfing like the bad old days when pop-up after pop-up would take you all over the internet and you could barley prevent it from happening.
You could try using an image as the background for a submit button. It may not look the same as an actual <intput type=image> but it would probably be close. The problem you described is typical of javascript to close a window or do other things, it leaves control to the user and not the javascript otherwise webpages could take control of your web surfing like the bad old days when pop-up after pop-up would take you all over the internet and you could barley prevent it from happening.
hi,
i did a lot of searching regarding this, and i found that <button type=submit>
can be used.
<button type=submit ><img src="images/go.gif" border="0" alt="Continue to the next page" /> </button>
but,i am getting a grey boxed border around the image, how can i make it disappear.
also, from where do i call my javascript code?
In your css:
button{
margin:0;
padding:0;
border:0;
}
Not a javscript guy but:
<button type=submit onclick="alert('hello')"><img src="image.png" border="0" alt="Continue to the next page" />
In your css:
button{
margin:0;
padding:0;
border:0;
}
Not a javscript guy but:
<button type=submit onclick="alert('hello')"><img src="image.png" border="0" alt="Continue to the next page" />
hi, it is calling its associated javascript code, but im still getting a boxed rectangular grey border around my image.
With that CSS in place? Need a link or the code.
With that CSS in place? Need a link or the code.
yes, with the css...............and the code u posted......
i tried putting an id, and identifying it but it still does not work...
yes, with the css...............and the code u posted......
i tried putting an id, and identifying it but it still does not work...
here is what i used:
<button type="button" onClick="window.close();"><img src="images/exit.jpg" border="0" alt="Exit!!" /> </button>
ive called my css file in the head section with the code uve posted..
There must be other markup affecting this. Here's my test page: - <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
-
"http://www.w3.org/TR/html4/strict.dtd">
-
<html>
-
<head>
-
<title></title>
-
<style type="text/css">
-
button{margin:0;padding:0;border:0}
-
</style>
-
-
</head>
-
-
<body>
-
<button type="button" onclick="alert('test');"><img src="1.gif" alt="Exit!!" /> </button>
-
</body>
-
</html>
hi, it is calling its associated javascript code, but im still getting a boxed rectangular grey border around my image.
what browser and browser version are you using?
what browser and browser version are you using?
hi, i tried the sample program u had posted, but im having the same problem.
im using Internet Explorer, version 6.0
this should work, no CSS required: - <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
-
"http://www.w3.org/TR/html4/strict.dtd">
-
<html>
-
<head>
-
<title></title>
-
-
</head>
-
-
<body>
-
<form><input type="image"
-
onclick="alert('Wassup?')";
-
src="frog.gif">
-
</form>
-
</body>
replace frog.gif with your image.
this should work, no CSS required: - <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
-
"http://www.w3.org/TR/html4/strict.dtd">
-
<html>
-
<head>
-
<title></title>
-
-
</head>
-
-
<body>
-
<form><input type="image"
-
onclick="alert('Wassup?')";
-
src="frog.gif">
-
</form>
-
</body>
replace frog.gif with your image.
ive tried this, but, its associated javascript on an <input type="image"> does not function properly.
Then this is a javascript problem and you need to go to that board for this.
ive tried this, but, its associated javascript on an <input type="image"> does not function properly.
Works fine for me in IE6, IE7 and FF2. Do you have javascript disabled maybe?
hi, it is calling its associated javascript code, but im still getting a boxed rectangular grey border around my image.
just put background-color in your css to match the color of the body and thats it:
button{
background-color:#FFFFFF;
margin:0;
padding:0;
border:0;
}
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Colin Steadman |
last post by:
I have two buttons on my form and need to know which was
clicked. If I setup the buttons like this:
<input type="submit" value="submit" name="submit_to_array">
<input type="submit"...
|
by: Csaba2000 |
last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE
5.5+). This should work regardless of whether IE has focus. Normally you would...
|
by: e |
last post by:
IE6. I have a form that can take a while to process once the user submits
it. So upon submittal of the form, the onclick event for the submit button
changes some text on the screen to say 'please...
|
by: Matt |
last post by:
In the following code, I have 2 questions regarding submit button with image.
1) Does this code <input type="image" name="populate" src="populate.gif">
behave the same as an HTML submit button...
|
by: Adam |
last post by:
Hey guys,
I've decided to stop banging my head against the wall and just ask you
guys for the answer. I can't seem to find it.
I have a form in which I have multiple submit buttons; only, I'm...
|
by: KiwiBrian |
last post by:
On a web page I have a graphic for a Shopping Cart Submit button.
It is within a form and working fine.
I would like to perform an image swap to an identical graphic of a
different colour when I...
|
by: David |
last post by:
Hello all. I am trying to implement my first server control and have
run into two problems that I cannot solve. I need the assistance of
someone with more experience.
My goal was to create an...
|
by: browntown |
last post by:
so I have this application I'm nearly finished with. The only thing the
client has requested is the ability to submit the form by pressing
"enter". I didn't think this would be a huge pain in the...
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
Hi all
I have the following code:
I am trying to use the value of the image button to evaluate what plan the
user has chosen, i.e. it request("submit1")="Basic", then the user chose
basic plan...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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: 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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |