Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 07-13-2009, 03:54 PM   #1
Money Grows On Trees...
War Room Member
 
Nick Brighton's Avatar
 
Join Date: May 2006
Location: In the trenches...
Posts: 2,375
Thanks: 553
Thanked 527 Times in 235 Posts
Contact Info
Send a message via Skype™ to Nick Brighton
Default How do I make my CSS submit button actually "submit"?

Hey all,

Wonder if you can help me? I'm trying to customize a form submit button using a css rollover like this:

#submit {
background-image: url(Images/button.png);
display: block;
height: 60px;
width: 299px;
}
#submit:hover {
background-position: 0 -60px;

}
#submit span
{
display: none;
}


The rollover/appearance looks fine in all browsers, but how do I turn this into an actual submit button without having the grey submit box showing up in the background?!

My html code is:

<table>
<tr>

<td width="240"><input name="Email1" type="text" size="40" ></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="button" input id="submit" />

</td>

I've tried changing input type from "button" to "hidden" but then it deactivates the button functionality.

Any help would be more than appreciated, really it would...

Nick Brighton is offline   Reply With Quote
Old 07-13-2009, 08:50 PM   #2
A rat after money...
War Room Member
 
HomeBizNizz's Avatar
 
Join Date: Jul 2009
Location: Inside a cheese...
Posts: 598
Thanks: 363
Thanked 54 Times in 47 Posts
Default Re: How do I make my CSS submit button actually "submit"?

You'll need the form tags too...

<form id="form1" name="form1" method="post" action="">
<input type="text" name="textfield" />
<input type="submit" name="Submit" value="Submit" />
</form>

action="process.php" sends to a PHP script f.ex...

HomeBizNizz is offline   Reply With Quote
Old 07-14-2009, 01:51 AM   #3
Kezz Bracey
War Room Member
 
Kezz's Avatar
 
Join Date: Dec 2008
Location: Australia
Posts: 1,291
Blog Entries: 5
Thanks: 323
Thanked 596 Times in 291 Posts
Default Re: How do I make my CSS submit button actually "submit"?

Try specifically telling your ID that it is applied to an input tag. eg. input#submit

Let us know if that works.

Kezz is offline   Reply With Quote
Old 07-14-2009, 03:17 AM   #4
Web Developer, IT Support
War Room Member
 
n7 Studios's Avatar
 
Join Date: Dec 2008
Location: Birmingham, UK
Posts: 513
Thanks: 10
Thanked 77 Times in 65 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: How do I make my CSS submit button actually "submit"?

PHP Code:
<html>
<
head>
<
style type="text/css">
#submit {
    
width299px;
    
height60px;
    
backgroundurl(button.gif0 0 no-repeat;
    
bordernone;
}
#submit:hover {
    
backgroundurl(button.gif-60px no-repeat;
    
cursorpointer;
}
</
style>
</
head>

<
body>
<
form action="" method="post">
    <
input type="submit" name="Submit" value="" id="submit" />
</
form>
</
body>
</
html
But this won't work in IE6 - IE6 doesn't support the :hover pseudo class on anything other than a link i.e. <a href...></a>

n7 Studios is online now   Reply With Quote
Old 07-14-2009, 12:38 PM   #5
Money Grows On Trees...
War Room Member
 
Nick Brighton's Avatar
 
Join Date: May 2006
Location: In the trenches...
Posts: 2,375
Thanks: 553
Thanked 527 Times in 235 Posts
Contact Info
Send a message via Skype™ to Nick Brighton
Default Re: How do I make my CSS submit button actually "submit"?

Thanks for the suggestions guys, but this still isn't working. I keep getting the grey box in the background instead of just the image.

Weird, any other ideas?

Nick Brighton is offline   Reply With Quote
Old 07-14-2009, 04:31 PM   #6
Web Developer, IT Support
War Room Member
 
n7 Studios's Avatar
 
Join Date: Dec 2008
Location: Birmingham, UK
Posts: 513
Thanks: 10
Thanked 77 Times in 65 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: How do I make my CSS submit button actually "submit"?

You've got some other CSS that's providing a grey background colour on input elements.

Get Firefox. Get Web Developer and Firebug plugins. Learn to use them. You'll be able to then see the CSS rules being applied to HTML elements, and fix these issues in seconds.

n7 Studios is online now   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
arrgh, driving, nuts, simple, task

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

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



All times are GMT -6. The time now is 08:31 AM.