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 14 2116
> 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="document.frm1.reset();">
best regards
deniz adrian
you can submit the form thru javascript. sthg like <img
src="button.gif"
onClick="javascript:document.forms['formName'].submit();">
> you can submit the form thru javascript. sthg like <img src="button.gif" onClick="javascript:document.forms['formName'].submit();">
as i understood, submitting isn't the problem, but resetting :)
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
Well, i use the same method for both buttons now,
so thank you guys. Is this method cross-browser/platform?
as far as i know both IE and NN has been supporting document.forms[]
since ver 4 or around
<c.**********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com... you can submit the form thru javascript. sthg like <img src="button.gif" onClick="javascript:document.forms['formName'].submit();">
IIRC not all UA versions support onclick on the image element.]
Jimbo
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... Whyyyyyyyyyyyyyy :(
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...
> Offline this works: <input name="Reset" type="image" value="Reset" src="button.gif" width="64" height="24">
what do you mean with "works"?
The upper code should submit the form, as a type="image" input in a form
always acts as a submit. What it never does is reset the form! Online it submits the form... Whyyyyyyyyyyyyyy :( The form is in a PHP-page, but that shouldn't be the issue....
If you don't want to submit it, nore reset it, simply use <img
src="image.jpg" alt="image" /> :)
best regards
deniz adrian
frizzle wrote on 10 mrt 2005 in comp.lang.javascript : Well, too bad guys, problem not solved:
Offline this works: <input name="Reset" type="image" value="Reset" src="button.gif" width="64" height="24">
<form id='q'>
<input name='x'><br>
<img src='submitbutton.gif'
onclick="document.getElementById('q').submit()">
<img src='resetbutton.gif'
onclick="document.getElementById('q').reset()">
</form>
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
Too bad guys, problem not solved :(
Still want to use an image-based button. I know the following works
offline:
<input name="Reset" type="image" value="Reset" src="button.gif"
width="64" height="24">
But as soon as i put it online, instead of resetting the form, it
submits the form. The page the form is in, is an PHP-generated page,
but that shouldn't be the issue.
I'd really like to find a solution for this, because i want to keep
the advantages of a 'real' button, instead of using an image with an
onClick event...
Thanks!
frizzle said: 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... Whyyyyyyyyyyyyyy :( 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....
An input of type image always submits the form.
There is no problem to solve except to find out why you want
to beat your head against this wall.
What advantages of a "real" submit button do you want to keep?
Ok, consider my previous post unsent, i had some problems with the
Google Groups. Anyway, i have the problem solved, don't know why it's
all of a sudden working right, but it is.. :)
Thanks guys! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
...
|
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...
|
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...
|
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: 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...
|
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...
|
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...
|
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: 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...
|
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...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
| |