Support Forums

Modify Submit Button to Image

This is a discussion on Modify Submit Button to Image within the Templates, HTML, CSS, and Design Help forums, part of the General category; How do you get the CSS and the code in layout.tpl to display an image for the submit button for ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 05-28-2009, 03:35 AM   #1
Member
 
Join Date: May 2009
Posts: 66
Rep Power: 0
Default Modify Submit Button to Image

How do you get the CSS and the code in layout.tpl to display an image for the submit button for the top search field? I am trying to get it so that there is no value set for the image but the code keeps inserting "Search" over the top of the image. If I remove the value for the image, "Submit Query" shows up over the image. Any help would be appreciated. Here is the site I am working on: Industrialpost.com.
industrialpost is offline   Reply With Quote
Old 05-28-2009, 05:40 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,498
Rep Power: 88
seymourjames is a jewel in the rough
Default

In layout use this for the button. The value defined for smarty.const.LANG_SEARCH_BUTTON is the text on the button, so if you define it to nothing, nothing will show on the button.

<input class="searchbutton" type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH_BUTTON}" />

Then in the css something like this (style as you want)

input.search { width: 279px; border: none; background: #fff url(../images/input.gif) no-repeat; padding: 6px 10px; color: #1E67A8; font-weight: bold; }
input.button { padding: 3px; }
input.searchbutton {background-color: #7B9E52;}

Then put the desired image input.gif in your images directory.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 05-28-2009, 01:19 PM   #3
Member
 
Join Date: May 2009
Posts: 66
Rep Power: 0
Default

Thanks for the input. However, this doesn't address the problem. I still have text over the image. How do I get rid of the text "Search" over the image? Like I said, if I don't declare any value, the text changes to "Submit Query" which should not show up. Anyone else have a clue about this? Where is this text being defined to show up regardless of any value being defined??? Please help. Industrialpost.com
industrialpost is offline   Reply With Quote
Old 05-28-2009, 01:26 PM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Try this. In the input.searchbutton {style.css (line 44) add:
text-indent:-1000px;
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-28-2009, 01:48 PM   #5
Member
 
Join Date: May 2009
Posts: 66
Rep Power: 0
Default

Thanks! That worked. I am assuming that this is relocating the text off screen. However, I added a few more zeros just to make sure that those users that have massive screens and high resolution set won't see an orphan "Search" hang out on the page somewhere. I was thinking about doing this, but wasn't sure if negative numerical values would work. Thanks again! Sweet!
industrialpost is offline   Reply With Quote
Old 05-28-2009, 02:55 PM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,419
Rep Power: 75
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Sometimes thinking negatively has a very positive affect.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 05-28-2009, 05:41 PM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,498
Rep Power: 88
seymourjames is a jewel in the rough
Default

Try

input type=image name="search" src="thepathway/image.gif"

instead of "type=submit".

++++
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 05-28-2009, 08:46 PM   #8
Member
 
Join Date: May 2009
Posts: 66
Rep Power: 0
Default

Ok, I spoke too soon. The solution worked great for Firefox. IE is a different story. Can anyone shed some light on this? I know, I know... IE is so behind the times! Industrialpost.com
industrialpost is offline   Reply With Quote
Old 05-29-2009, 02:28 AM   #9
Just get on with it!
 
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 506
Rep Power: 36
michael is just really nice michael is just really nice
Default

I am using the default template and whenever I want to change a text link to a button I include the following in the anchor;

Code:
class="bluebtn" or class="greenbtn"
The following goes in my CCS file;

Code:
/* misc */
.buttons { text-align: right; padding: 4px 3px 0 0; }
.left_articles .buttons { float: right; height: 20px; }
.bluebtn { background: url(../images/bluebtn.gif) no-repeat; width: 100px; padding: 1px 16px 5px 16px; color: #fff; font-weight: lighter; text-decoration: none; }
.greenbtn { background: url(../images/greenbtn.gif) no-repeat; padding: 1px 17px 5px 16px; color: #fff; font-weight: lighter; text-decoration: none; }
.bluebtn:hover, .greenbtn:hover { background: url(../images/hoverbtn.gif) no-repeat; color: #fff; font-weight: lighter; }
You should already have the .gif files in your default images folder, just copy them over to your customtemplate/images folder.

Good luck,

__________________
M Michael
V4.2.3 Developer - Sigma Template


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Old 05-29-2009, 11:10 AM   #10
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,498
Rep Power: 88
seymourjames is a jewel in the rough
Default

Which version of I.E.? You may have to use some conditional css to cover I.E. around your button. Search the forum as there are several threads on that. I thnik what Mike says should work though.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify 68 classifieds so users can submit trade offers naidu01 Technical Support 2 01-18-2009 09:13 AM
<button> as Submit button bowers01 Templates, HTML, CSS, and Design Help 1 09-27-2008 06:21 AM
Modify Button ? VikingBEAR Technical Support 1 05-11-2008 12:57 AM


All times are GMT -4. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0