Solved

Change Style of Button OnDisable

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now