11 replies [Last post]
smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

I have this graphic button I want to use and call it from a css file only The code is viewed as:

But this doesn't work in a form?

I need the button to not be hard coded because the themes are going to be switched out and each search form button will match the respective theme. Therefore, the normal src="image" code won't work.

Does anyone have some suggestions of how to make a graphic css button work in a search form?

Thanks!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Why doesn't it work? what

Why doesn't it work? what exactly doesn't work? can you be a little more specific as to what you have tried.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

Sorry. I'm trying to get

Sorry. I'm trying to get the script to work from just a static page for now.

Here is the full form code:

 

Is this proper because when I click on the search button it doesn't go anywhere? Are you saying the button code should work? Your thoughts?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

if I drop your button

if I drop your button element into a form along with

button {
  width:60px;
  height:25px;
  background: url(../images/access.jpg) no-repeat;
  text-indent:-3000em;
}

I get a nice bevelled graphical button which submits to my 'action' destination without problem.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

hmmm... well that's strange.

hmmm... well that's strange. I guess I'll keep playing with it? Does this occur when your page is connected to a server also?

Thanks

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

I dropped it into a live

I dropped it into a live form on my server yet directing to a non existing receiving script so it attempts to send but returns a 404 'file not found' error.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

ok - thanks for your time.

ok - thanks for your time.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Solved? is it working , and

Solved? is it working , and with your background image?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

Yes, I got it to work but

Yes, I got it to work but not with search.html- not sure why? I changed the action to "search.asp" and it works just fine. Thanks!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

no problem, sounds as though

no problem, sounds as though search.html would not have been able to process the script it contained same as if I tried to send to an html extension that had PHP scripting needing to be parsed, it wouldn't as I haven't set the server up to parse .html

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

smk2007
smk2007's picture
Offline
Enthusiast
Last seen: 9 years 41 weeks ago
Timezone: GMT-8
Joined: 2007-01-04
Posts: 135
Points: 7

Yes, at first I thought it

Yes, at first I thought it was my css code but you helped resolve that wasn't the problem. So I extended my issues beyond the horizon. Smile Thanks again.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Ah that dam horizon, can be

Ah that dam horizon, can be a tiring long way away at times Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me