Solved

Change Style of Button OnDisable

Posted on 2002-07-15
2
1,062 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
[X]
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
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
Suggested Courses
Course of the Month10 days, 13 hours left to enroll

628 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