Solved

Change Style of Button OnDisable

Posted on 2002-07-15
2
1,047 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 41
how can i make the array into an object? 4 30
Javascript_Set_dropdown_value 7 32
Scroll 5 news at a time. 4 26
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

776 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