473,670 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image As Button Problem :(

Hi there,

I have a form on a contact page, and to make the layout
cross-browser/-platform i want to use an image as a button
instead of using an image as background on a button....

Problem: When i insert a (e.g.) reset-button, and change the source
type="button" to type="image", instead of resetting the form, it
submits the form....

Any clues?

Thanks...

Frizzle

Jul 23 '05 #1
14 2156
> Problem: When i insert a (e.g.) reset-button, and change the source
type="button" to type="image", instead of resetting the form, it
submits the form....


A type="image"-input always acts as a submit.
You can put javascript onclick to the picture.
e.g.

<image src="images/foo.jpg" onclick="docume nt.frm1.reset() ;">

best regards
deniz adrian
Jul 23 '05 #2
you can submit the form thru javascript. sthg like <img
src="button.gif "
onClick="javasc ript:document.f orms['formName'].submit();">

Jul 23 '05 #3
> you can submit the form thru javascript. sthg like <img
src="button.gif "
onClick="javasc ript:document.f orms['formName'].submit();">


as i understood, submitting isn't the problem, but resetting :)

Jul 23 '05 #4
of course, you can use any of the reset() or submit() methods on your
form. I was trying to suggest that you dont use input, instead you can
use img as well and get through.
Thanks
Anand

Jul 23 '05 #5
Well, i use the same method for both buttons now,
so thank you guys. Is this method cross-browser/platform?

Jul 23 '05 #6
as far as i know both IE and NN has been supporting document.forms[]
since ver 4 or around

Jul 23 '05 #7
Allrighty, thanks!

Jul 23 '05 #8

<c.**********@g mail.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
you can submit the form thru javascript. sthg like <img
src="button.gif "
onClick="javasc ript:document.f orms['formName'].submit();">

IIRC not all UA versions support onclick on the image element.]
Jimbo
Jul 23 '05 #9
Well, too bad guys, problem not solved:

Offline this works:
<input name="Reset" type="image" value="Reset" src="button.gif "
width="64" height="24">

Online it submits the form... Whyyyyyyyyyyyyy y :(
The form is in a PHP-page, but that shouldn't be the issue....

Please helpe me out on this one, i really want to keep the advantages
of a 'real' submit button instead of an image with an onClick
element....

Thanks...

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6890
by: Marek Mänd | last post by:
Can the <button><img></button> mutated via CSS so, that the inner image of <BUTTON> would entirely visually become the button itsself - I mean without the outer elements borders and so... I tried removing paddings and borders and margins but this wouldnt seem to help. in MSIE, Mozilla and Opera - there still some pieces of the
4
2438
by: Ester | last post by:
I have an interior design of a living room with lights and aircond image. My task is to load the living room image without any light and aircond images as background image of a WebForm after that I have to add image button which are lights and aircond images on top of this background image (living room). Instead of drag and drop an image button from the toolbox and browse the image link, I would like to load the image for the image button from...
2
2705
by: Ester | last post by:
Instead of drag and drop image button from Toolbox and name the image button id on the properties box, I would like to load image button ID from database. I created a database table that stores Image Button ID and Image (path name of the image for the image button). Example of the data will be: (ImgBtnLight, image\light.gif). The data type of the Image Button ID field in the database table is varchar whereas data type of image button in...
2
3499
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 with image populate.gif? When I click p1 or p2 button, it will post the page to process.asp. 2) When I check the checkbox, I want the image in submit button change from populate.gif to validate.gif. Unfortunately, the code InputForm.p2.src =...
15
31797
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and help. Regards
0
1900
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll" "Additional information: Invalid parameter used." Here is my code:-
1
6127
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is pressed. To do this I set the type to hidden and changed the type of the button using javascipt to image. This works perfectly in Modilla's Firefox but in IE it says there is a scipt error. Here is the javascipt
16
2861
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 ass and the app will be used internally so I'm not too worried about users who aren't using javascript. I'm using the following javascript to detect whether or not they've hit enter: if(document.layers) {
2
2361
by: Poppa Pimp | last post by:
ImageResizer.php Image Resizer PLEASE HELP The URL of the page this is on in my site is http://poppa-pimps-wallpapers.com//ImageResizer.php You can click on browse and get image,but when you upload image it will go to another page and says ]((unable to create emp directory)) Here is a site to be able to see script actually work http://tech.tailoredweb.com/image-editor-52/ and can be DL from there also. I am using FP 2003 and...
4
5026
by: Marcolino | last post by:
Hi, I have simple needs but I don't know how to implement it. I have application that create Dynamic Button. I need to set the image on this button, getting the icon from a form. So pratically I need to convert dinamically a Form.Icon to Button.Image runtime, but i don't know how. Any help would be appreciated. Many Thanks
0
8468
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
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8591
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,...
1
6213
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
5683
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
4209
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...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
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
2
2041
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.