Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change Style of Button OnDisable

Posted on 2002-07-15
2
Medium Priority
?
1,066 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

670 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