Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1662 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Replacing a submit button with a custom image

Thread title: Replacing a submit button with a custom image
Closed Thread    
    Thread tools Search this thread Display Modes  
12-19-2007, 10:31 AM
#1
authenticstyle is offline authenticstyle
authenticstyle's Avatar
Status: I'm new around here
Join date: Nov 2007
Location: Salisbury, UK
Expertise:
Software:
 
Posts: 9
iTrader: 0 / 0%
 

authenticstyle is on a distinguished road

Send a message via MSN to authenticstyle

  Old  Replacing a submit button with a custom image

Hi guys,

Im currently developing a site where I need to replace the default form submit buttons with custom images.

I know how to do this to some extent. For example I can replace the default button with a background image, and then have the 'Submit' text sitting on top of that, but I want the WHOLE thing to be a graphic. So I need to get rid of the 'Submit' text somehow.

Heres an example image showing the whole form, just to give you a better idea...


And heres the button graphic...


Any help would be greatly appreciated. Thanks in advance!
Will

12-19-2007, 02:12 PM
#2
Crazymik3 is offline Crazymik3
Status: Member
Join date: Apr 2007
Location:
Expertise:
Software:
 
Posts: 143
iTrader: 4 / 100%
 

Crazymik3 is on a distinguished road

Send a message via AIM to Crazymik3 Send a message via MSN to Crazymik3

  Old

This is what you could do:
Style it with the background image, width, height etc,

And then this:
Code:
<input name="name" type="submit" value="" />

12-19-2007, 02:22 PM
#3
authenticstyle is offline authenticstyle
authenticstyle's Avatar
Status: I'm new around here
Join date: Nov 2007
Location: Salisbury, UK
Expertise:
Software:
 
Posts: 9
iTrader: 0 / 0%
 

authenticstyle is on a distinguished road

Send a message via MSN to authenticstyle

  Old

I have tried doing that Crazymik3 .

Unfortunately IE7 doesn't like it and just gives a blank default style button.

12-19-2007, 05:56 PM
#4
Joe is offline Joe
Status: Custom User Title
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 2,297
iTrader: 0 / 0%
 

Joe is on a distinguished road

  Old

If you want to use an image, the best way is to use the type "image" for the input tag.

Code:
<input type="image" src="/image/src.png" value="Send Your Message" />

12-19-2007, 06:04 PM
#5
authenticstyle is offline authenticstyle
authenticstyle's Avatar
Status: I'm new around here
Join date: Nov 2007
Location: Salisbury, UK
Expertise:
Software:
 
Posts: 9
iTrader: 0 / 0%
 

authenticstyle is on a distinguished road

Send a message via MSN to authenticstyle

  Old

Awesome, that worked.

Cheers Joe. .

12-21-2007, 05:06 PM
#6
George the Flea is offline George the Flea
Status: Junior Member
Join date: Dec 2007
Location: Seattle, WA
Expertise:
Software:
 
Posts: 52
iTrader: 0 / 0%
 

George the Flea is on a distinguished road

  Old

Just for future reference:

If there is no submit button, the first image button will by default act like a submit (I'm pretty sure this is the default behavior across all browsers; someone may feel free to correct me if I'm mistaken).

01-02-2008, 01:39 PM
#7
Technokinetics is offline Technokinetics
Status: I'm new around here
Join date: Aug 2007
Location: Gloucestershire, England
Expertise:
Software:
 
Posts: 17
iTrader: 0 / 0%
 

Technokinetics is on a distinguished road

  Old

Originally Posted by George the Flea View Post
Just for future reference: If there is no submit button, the first image button will by default act like a submit.
Useful; I didn't know that. Thanks.

01-05-2008, 02:43 PM
#8
freelancergod is offline freelancergod
Status: I'm new around here
Join date: Jan 2008
Location:
Expertise:
Software:
 
Posts: 15
iTrader: 0 / 0%
 

freelancergod is on a distinguished road

  Old

Been reading posts and comments, very good info thaks

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed