Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
How do I use an image for a search button?
Old 04-28-2008, 11:11 PM How do I use an image for a search button?
goheadtry's Avatar
Webmaster Talker

Posts: 726
Name: John
Location: United States of America, California
Trades: 0
I have a question: "How do I use an image for a search button?

so instead of a button I have a a graffic
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 04-29-2008, 07:49 AM Re: How do I use an image for a search button?
Extreme Talker

Posts: 189
Trades: 0
<INPUT TYPE="IMAGE" SRC="" NAME="" VALUE="">

just put in a src, name and a value and put it in your code (before the </form>)
simster is offline
Reply With Quote
View Public Profile
 
Old 04-29-2008, 08:02 AM Re: How do I use an image for a search button?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I'm not sure about it, but it may need an "onclick" event, to trigger the form submit:
Code:
<form name="frmSomething" method="post" action="someWhere">
  <input type="text" name="inpTxt1"/>
  <input type="image" src="/img/buttonGo.jpg" name="inpImgSub" value="" onclick="document.frmSomething.submit()"/>
</form>
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-29-2008, 02:55 PM Re: How do I use an image for a search button?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
onclick="document.formname.submit()
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-30-2008, 02:50 AM Re: How do I use an image for a search button?
Junior Talker

Posts: 3
Trades: 0
Quote:
Originally Posted by tripy View Post
I'm not sure about it, but it may need an "onclick" event, to trigger the form submit:
Code:
<form name="frmSomething" method="post" action="someWhere">
  <input type="text" name="inpTxt1"/>
  <input type="image" src="/img/buttonGo.jpg" name="inpImgSub" value="" onclick="document.frmSomething.submit()"/>
</form>
This is useful anyway
and you can also make a background image
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
getsoz is offline
Reply With Quote
View Public Profile
 
Old 04-30-2008, 05:13 AM Re: How do I use an image for a search button?
.Gary's Avatar
Experienced Talker

Posts: 43
Name: Gary
Location: Colchester, UK
Trades: 0
HTML Code:
<form name="frmSomething" method="post" action="someWhere">
  <input type="text" name="inpTxt1" />
  <input type="submit" name="submit" value=" " class="submit" />
</form>
Code:
.submit {
    border: 0;
    height: 15px;
    width: 40px;
    background: url(images/submit.gif) no-repeat center center #001;
}
Hurrah.
__________________
» For Hire:
Please login or register to view this content. Registration is FREE

»
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
- real.forum.design.by.experts
.Gary is offline
Reply With Quote
View Public Profile Visit .Gary's homepage!
 
Old 04-30-2008, 07:04 PM Re: How do I use an image for a search button?
goheadtry's Avatar
Webmaster Talker

Posts: 726
Name: John
Location: United States of America, California
Trades: 0
Maybe I should mention what if I am using it for a php/mysql search form that uses another page. Also what if there is more then one form?
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 04-30-2008, 10:22 PM Re: How do I use an image for a search button?
Banned

Posts: 81
Location: kavoir.com
Trades: 0
Quote:
Maybe I should mention what if I am using it for a php/mysql search form that uses another page. Also what if there is more then one form?
Just replace the old routine <input type="submit" .. with <input type="image" ... and you'll be fine.

It's the same with multiple forms. Or you could try to make different values among all the submit buttons with the same 'name'.
yangyang is offline
Reply With Quote
View Public Profile Visit yangyang's homepage!
 
Old 05-01-2008, 12:59 PM Re: How do I use an image for a search button?
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Each form requires its own submission button. To seperate a form out visually, use fieldsets.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-02-2008, 10:45 AM Re: How do I use an image for a search button?
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
I suggest using a background image as .Gary suggested. That way, you maintain the semantics of the submit button, and still gain the visual appeal that you want. Screen readers will be better able to interpret what you want, also.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to How do I use an image for a search button?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34091 seconds with 12 queries