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

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

so instead of a button I have a a graffic
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
When You Register, These Ads Go Away!
     
Old 04-29-2008, 06:49 AM Re: How do I use an image for a search button?
Extreme Talker

Posts: 163
<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, 07:02 AM Re: How do I use an image for a search button?
tripy's Avatar
Fetchez la vache!

Posts: 1,849
Name: Thierry
Location: In the void
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>
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 04-29-2008, 12:08 PM Re: How do I use an image for a search button?
Novice Talker

Posts: 10
Name: redhat
<input type="image" src=".jpg" onclick="dosubmit()"/>
__________________
http://www.imhr.net
imhr is offline
Reply With Quote
View Public Profile Visit imhr's homepage!
 
Old 04-29-2008, 01:55 PM Re: How do I use an image for a search button?
chrishirst's Avatar
Super Moderator

Posts: 11,767
Location: Blackpool. UK
onclick="document.formname.submit()
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-30-2008, 01:50 AM Re: How do I use an image for a search button?
Junior Talker

Posts: 3
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
getsoz is offline
Reply With Quote
View Public Profile
 
Old 04-30-2008, 04:13 AM Re: How do I use an image for a search button?
.Gary's Avatar
Experienced Talker

Posts: 34
Name: Gary
Location: Colchester, UK
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: vBulletin Skin Coding
» TalkHXC - Hardcore Music Forums
.Gary is offline
Reply With Quote
View Public Profile Visit .Gary's homepage!
 
Old 04-30-2008, 06:04 PM Re: How do I use an image for a search button?
goheadtry's Avatar
Webmaster Talker

Posts: 708
Name: John
Location: United States of America, California
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?
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 04-30-2008, 09:22 PM Re: How do I use an image for a search button?
yangyang's Avatar
Skilled Talker

Posts: 51
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'.
__________________
40000 pages+1900 images = Free Instant Site!
With 4 years front end web development experience, we offer state of the art PSD to XHTML / CSS slicing service, starting at $129.
yangyang is offline
Reply With Quote
View Public Profile Visit yangyang's homepage!
 
Old 05-01-2008, 11:59 AM Re: How do I use an image for a search button?
Mooofasa's Avatar
Defies a Status

Posts: 1,612
Name: Michael (mik) Land
Location: England
Each form requires its own submission button. To seperate a form out visually, use fieldsets.
__________________
Tumblings.co.uk - Tumblog with thoughts, quotes, links, videos, images and my creations.
Opera Browser - The best free web browser.
Opera Dev Tools - Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-02-2008, 09:45 AM Re: How do I use an image for a search button?
nickohrn's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
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.
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
nickohrn is offline
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Reply     « Reply to How do I use an image for a search button?
 

Thread Tools

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

vB 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.16582 seconds with 13 queries