codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » HTML » Article

HTML Image Submit Button

Article by:  Jeff Anderson  ( 1362 ) (1/24/2002)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Summary: You can keep your forms from slipping into mundanity by substituting the default gray submit button to a colourful graphic of your choosing.
Viewed: 628841 times Rating (264 votes): 
 4 out of 5
 Rate this Article  Read Comments  Post Comments




HTML Image Submit Button


Form buttons don't have to be dull and grey! You can use images to submit a form too. Here's an example:


Name
Address

Here's the code to get that image in there :


	

<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form">

Where the standard submit button has TYPE="submit", we now have TYPE="image". The image type is by default a form submitting button. Oh, by the way, you can see another example of this on CodeToad itself. Take a look at the Go button in our search box!





CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'HTML Image Submit Button'
Posted by :  Archive Import (Andy Rickel) at 04:52 on Sunday, February 02, 2003
where do you choose the option to send this form?
Posted by :  Archive Import (Strawliyah) at 04:50 on Monday, March 17, 2003
OR you can do it a easier way....

<img src="image-url-here" width="85" height="95" border="0">

i don't know about ya, but this is quicker (to me) than that other html code they plugged in.
Posted by :  Archive Import (dave) at 07:20 on Monday, March 17, 2003
Strawliyah 0- that just creates an image, not a form submission.

Andy - you need to place the code within standard form tags eg.
<form action=default.asp method=post>
<!-- image button and form here-->
</form>

Just look at the source of this page to find out more.
Posted by :  Archive Import (Kelly) at 15:25 on Saturday, April 05, 2003
Hey just checking something. wanna know how I can do a submit button that would automatically... send the answers to my email.
Posted by :  Archive Import (Murtazaa Tanbeer) at 12:05 on Tuesday, April 08, 2003
How can I inclule multiple image submit button in one HTML form?

I need this thing very badly.
Posted by :  Archive Import (Becky) at 21:44 on Friday, April 18, 2003
To Kelly... to send the answers to your email, put this code in your FORM tag:

<FORM enctype="text/plain" ACTION="mailto:you@email.com?subject=Subject of email" METHOD="POST">

where you@email.com is the email address you want to send the information. Replace the word 'Subject' with what you want to be the subject of your email.
Posted by :  Archive Import (Colby) at 13:23 on Tuesday, May 20, 2003
I'm trying to design a website with the Submit button. Although it works, it always brings up a dialog box that says, "This form is being submitted using email. blah blah blah. You can either continue or cancel. Yes No" Then it opens my outlook express and a blank email. How can I make the Submit button actually submit the info without all of this?
Posted by :  Archive Import (Ed) at 11:44 on Friday, May 30, 2003
I have a form where the data entered goes into a database and both the user and myself would recieve an email. When I used the conventional method of submit, the form worked fine. Now, I used the image for submit and the form goes to the next page but no data gets entered into the database nor do any of us recieve an email. Does this image method act different when theer is an ASP involved?
Posted by :  Archive Import (iverson) at 13:23 on Thursday, June 12, 2003
I'm trying to design a flash button through using html. but i'm a little confuse with the usage of <object> and <embed>. Have any idea what should i actually do?
Posted by :  Archive Import (Primo) at 06:25 on Monday, June 16, 2003
Does anybody know how to create a Submit Button on a popup window that appears when viewer tries to leave a webpage?
Posted by :  Archive Import (Mark) at 15:05 on Thursday, June 19, 2003
I happen to be using ASP in my page, and found this code to work just fine. I use it as a Go! button right beside a form field where people can enter their email address to receive a newsletter. The button triggers a separate ASP page to receive the data and post to the database.

The previous method I used was a javascript button, which required not only the little snippet of code for the button itself, but also a separate 4 - 5 line function to drive it. This is much better!
Posted by :  Archive Import (Jennifer Jaeger) at 16:51 on Tuesday, June 24, 2003
Does anyone know how to create CSS buttons for forms?
Posted by :  Archive Import (Shadow of the Last) at 08:01 on Saturday, July 19, 2003
To make a form the submits all of its contents to you, heres a little PHP script I made:

<?php
$question1 = ($_POST["First_question"]."\n");
$question2 = ($_POST["Question_2"]."\n");
$question3 = ($_POST["Question_3"]."\n");
$body = "Answer 1: $question1 Answer2: $question2 Answer3: $question3";
( "you@yourmail.com" , "Subject", $body );
?>
----------------------------------
When you get the E-mail it will look like This:
Answer 1: (whatever answer the person submitted)
Answer 2: (whatever answer the person submitted)
Answer 3: (whatever answer the person submitted)
-----------------------------------
put this script on its own page(i.e. sending.php)in the same directory, and then put this at the top of your form:
<form method="post" action="sending.php">

have fun :D

Posted by :  Archive Import (dsullinger) at 13:49 on Wednesday, August 06, 2003
I would like to place a SWF (Flash) file in place of the image file, is this possible? I would like the user to click on the flash object and it submits the data.
Posted by :  Archive Import (Bbk) at 17:02 on Tuesday, August 12, 2003
How did you get the .gif image that you used in SRC="images/submit.gif"?

Posted by :  Archive Import (Squall Strife) at 21:40 on Tuesday, August 19, 2003
Couldn't you make a JavaScript script that would send all form text and selections (like a radio button) to a specific e-mail? I know a good deal about HTML, DHTML, and a litlle about JavaScript and CGI which is very helpful in creating "submit" buttons. I just want a code that I can copy and paste to my document that will create a button that brings up a page thayt says "Your query(bad spelling if it's wrong) has ben sent to mye-mail@whatever.com" and actually sends the information. Oh, and this is a little off subject but how do you create a poll that when you vote it shows how many votes each option has?
Posted by :  Archive Import (Sipan) at 13:44 on Sunday, September 07, 2003
how do i make a submit button that submits info to my email?
Posted by :  antriksh at 23:25 on Friday, July 23, 2004
Hi.. I would like to create a submit button where the word entered forms the end part of a link. For example, if typed 4444 in the submit button it forms the part of the standard link www.antriksh.com.asp? and thus becomes www.antriksh.com.asp?4444
GREATELY NEED THE BUTTON
Posted by :  tpar at 13:48 on Wednesday, November 10, 2004
I have a table where I need to give the user the option of clicking on a button on each line to add another line to the table. I need to know what the index of the line is so that I know where to add the new line. I have this working except that my button currently shows the index number. I want it to display as a plus sign. I was hoping that using the image type would work, but now I'm not getting the index value returned in the form. My HTML statement is as follows:
(input type="image" name="submit" src="images/plus.gif" value=index </td>

Is there a restriction that does not allow me to use "value" when the type is image?
Posted by :  Sly at 19:02 on Wednesday, March 23, 2005
There is a problem with this and Mozilla.

If the setting to 'block images from this server' is invoked then the image submit button 'vanishes' and there is no way to submit the form. This does not, of course, happen with the 'standard' grey button as its not an image. If the image cannot be displayed then the alt text is shown but unfortunately this is not done when the images are blocked.
Posted by :  aakash at 03:01 on Friday, March 03, 2006
I have a problem with image button.

When I tried to submit the form using image submit button
example - <input type=image src="xyz.gif" name="Submit" value="go">

it submits the coordinates of x and y instead of value "go". But I needed the value of submit

Please tell me how to acheive this.

I needed this very badly.
Posted by :  bookwrm54 at 18:24 on Saturday, September 23, 2006
I have the same problem as aakash. Whenever I use an image for the Submit button, the email sent to me with the information from the fields always includes the x and y values with different numbers each time as follows:

X: 6
Y: 16

How do you insert the code so that those values are not returned?

Thanks!
Posted by :  ca7a at 17:01 on Monday, February 19, 2007
i have the same problem like Kelly, i can't send the answers to my e-mail. i saw that i have to add <FORM enctype="text/plain" ACTION="mailto:you@email.com?subject=Subject of email" METHOD="POST"> on my form tag but i dunno which is my form tag (i am a newbie). is it correct like this?

<FORM enctype="text/plain" ACTION="mailto:cata2hot4u@hotmail.co.uk?subject=Subject of email" METHOD="POST">
<label>
<div align="right">
<input type="submit" name="Submit" value="Submit" />
</div>
</label>
</form>


or how should be? need help asap.
Posted by :  marque1 at 04:46 on Tuesday, April 03, 2007
Hi there,

answer to many of these questions you can find from nice article:

[b]http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html[/b]
Posted by :  Geoff at 16:00 on Sunday, March 22, 2009
Hi, I have created a form for people to advertise camping equipment, I am allowing advertisers to send me three photos of their items, my submit button works great but how can I add a button or three allowing people to browse their computer to add images in their reply without having to send a seperate email with images attached. Please help and try to keep it simple only a novice
Posted by :  davidvilla at 01:27 on Saturday, October 24, 2009
the DOJ was not acting with integrity and politics was in play. Regardless of how you felt about the trial, the principle was a man was not getting a fair trial and no one could cast guilt or innocence, because of the corruption within the DOJ.
As for the duplicity in your opinion and others like Sherry's who hold such high regard for pro-life records and tear down Palin, it is telling how sincere you are when you can want to vote in a politician who clearly has a record on abortion rights that falls below that of Palin's.
Dan, you continue to leave yourself open to be called a hypocrite [url=http://www.riseuniversity.com/Programs/Degree/PhD-Degree.html]online Phd degree[/url] - [url=http://www.riseuniversity.com/Programs/Degree/foundation-degree.html]online foundation degree[/url]


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
Image Submit Button
by Jeff Anderson
You can keep your forms from slipping into mundanity by substituting the default gray submit button to a colourful graphic of your choosing.
Parent _self _blank and _top Frame Target Specifications
by Jeff Anderson
How to specify frames and how to break out of them using standard link tags.
Pre Tag
by Jeff Anderson
No need to reformat text files with line breaks and tabs if you use the pre tag
Image Rollovers
by Jeff Anderson
A bit of code to swap to different images on the page. You often see this on sites to display a rollover on the navigation buttons.
ASCII characters and their codes
by Jeff Anderson
A full list of all the ASCII characters.
In-Line Frames (IFrames)
by Jeff Anderson
Inline frames or IFrames are the ones which appear in the midst of a standard page, but actually reference a totally separate url.
Validate Date
by Kannadasan Ramiah
Validating Date entered in a text box, pure HTML page
HTML Hspace and Vspace Image Borders
by Jeff Anderson
A lesser known feature in HTML is the ability to add a blank border around images both horizontally and vertically.
Creating Navigation with Frames
by Jeff Anderson
The most popular use of frames is to allow a static navigation to stay on one part of the screen (in one frame) while the content changes in another.
The OSI Reference Model - A Clear and Concise Illustration !
by James Opiko
The OSI Reference Model - A Resource For IT Certification Candidates & Networking Professionals








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009