Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Change Style of Button OnDisable

Posted on 2002-07-15
2
1,052 Views
Last Modified: 2007-11-27
Here is some easy points for those who know the answer.
I want to change the Style for the button or when I disable the button I want to turn the color of the button to Grey to make sure they can see it is disabled.

<form name="checkout">
<input type="text"
       name="quantity_#OreckDealerCart_ID#"
       value="#quantity#" size="3"
       maxlength="4"
       onchange="codename()"
       onkeypress="return maskKeyPress(event)">

<input type="submit"
       name="submit"
       value="Order"
       class="TableBody_Button">
</form>


<SCRIPT LANGUAGE="JavaScript">
<!--
function codename() {
document.checkout.submit.disabled=true;
}
//-->
</SCRIPT>
0
Comment
Question by:nathans
2 Comments
 
LVL 3

Accepted Solution

by:
tejaspurani earned 50 total points
ID: 7154791
Try This
<form name="checkout">
<input type="text"
      name="quantity_#OreckDealerCart_ID#"
      value="#quantity#" size="3"
      maxlength="4"
      onchange="codename()"
      onkeypress="return maskKeyPress(event)">

<input type="submit"
      name="btn1"
      value="Order"
      class="TableBody_Button" onclick="test()">
</form>


<SCRIPT LANGUAGE="JavaScript">
<!--
function test(){
 document.checkout.btn1.style.background = "#666699";
 document.checkout.btn1.disabled=true;
}
function codename() {
//document.checkout.submit.disabled=true;
}
//-->
</SCRIPT>
0
 
LVL 5

Author Comment

by:nathans
ID: 7154810
Thanks I knew it would be easy

Error
document.checkout.btn1.style.BACKGROUND-COLOR = "#666699";

Works
document.checkout.btn1.style.background = "#666699";

I was close but now I got it.

Thanks


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question