Javascript: How to Color a Button in Javascript?

  • CGFX
  • Graduate
  • Graduate
  • User avatar
  • Posts: 161
  • Loc: Chicago, IL.

Post 3+ Months Ago

All,

If there is already a post for this then please link me there. I need the code to color both a Submit button and a Reset button to a bright yellow. On this page http://atlanticarlimo.com/contact.htm I need the code for those buttons at the bottom. Here is the current code I have for those buttons.

Submit Button
Code: [ Select ]
<input name="submit" type="submit" class="formfields" style="width: 79; height: 40" col onClick="MM_popupMsg('Your reservation has been submited. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thank You for booking your ground transportation with AtlantiCarLimo. Someone will be contacting you as soon as possible.')" value="Submit" />


Reset
Code: [ Select ]
<input name="Reset" type="reset" class="formfields" id="Reset" style="width: 79; height: 40" value="Reset" />


Can it be done?

Thank you,

cgfx
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Why don't you do it with CSS?
CSS Code: [ Select ]
input[type=submit] {
   background-color: #dddddd;
}
 
input[type=reset] {
   background-color: #ff0000;
}
  1. input[type=submit] {
  2.    background-color: #dddddd;
  3. }
  4.  
  5. input[type=reset] {
  6.    background-color: #ff0000;
  7. }
  • CGFX
  • Graduate
  • Graduate
  • User avatar
  • Posts: 161
  • Loc: Chicago, IL.

Post 3+ Months Ago

Bogey,

Thanks your the best. By the way, what do you do in this field?

Best,

cgfX
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Why don't you check out my site? I tell that on the first page http://www.wedevoy.com :)
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

CGFX wrote:
http://atlanticarlimo.com/contact.htm


Groovy music, dude.

But tables?!
  • gkumar
  • Beginner
  • Beginner
  • gkumar
  • Posts: 39

Post 3+ Months Ago

try this code:-

Quote:
<INPUT type=button
value="My Button"
style="background-color:blue; color:white;"
onMouseOver="this.style.bgColor = 'red';"
onMouseOut="this.style.bgColor = 'blue';"
onClick="self.location='mypage.asp';"
>
  • CGFX
  • Graduate
  • Graduate
  • User avatar
  • Posts: 161
  • Loc: Chicago, IL.

Post 3+ Months Ago

alex89,

I just did the update, I am not the original designer. I feel you, CSS all the way.

cgfx
  • CGFX
  • Graduate
  • Graduate
  • User avatar
  • Posts: 161
  • Loc: Chicago, IL.

Post 3+ Months Ago

gkumar,

Thanks, Nice code, I try that one next.

cgfx

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.