Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 21st, 2005, 04:15 AM
Friend of Wrox
Points: 7,425, Level: 36
Points: 7,425, Level: 36 Points: 7,425, Level: 36 Points: 7,425, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,524
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default change the style

I have a text box.....

<input type="text" class="input" tabindex="5" name="retdt" maxlength=5 size=13 onfocus="removeYear('retdt')" onblur="return checkdate('/T2AgIBE/html/calendar.html','document.fexp.retdt.value','docume nt.fexp.rettm.value','ret',document.fexp.crdate.va lue,document.fexp.seldate.value,'retdt')" onChange="javascript:this.value=this.value.toUpper Case();">

How do i grey it out (change the style) to background color = grey when it is disabled.

Picco

__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old January 21st, 2005, 04:24 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

I was thinking the textbox would be greyed out automatically if it is disabled!! Isn't it greying it out when you say element.disabled=true?

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
  #3 (permalink)  
Old January 21st, 2005, 04:45 AM
Friend of Wrox
Points: 7,425, Level: 36
Points: 7,425, Level: 36 Points: 7,425, Level: 36 Points: 7,425, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,524
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

the border greys out, but i wanted the bgcolor to be grey!

  #4 (permalink)  
Old January 21st, 2005, 04:51 AM
Friend of Wrox
Points: 7,425, Level: 36
Points: 7,425, Level: 36 Points: 7,425, Level: 36 Points: 7,425, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,524
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

function displayOpenJaw(val){
// alert("in")
    if (val=="openjaw")
    {
     for(i=0;i<document.fexp.oneret.length;i++)
   {
      document.fexp.oneret[i].checked=false
     }
    newtabledata.innerHTML = '<b>From</b>';
    newtabledata2.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;<b>To</b><br>';
    depapt2.innerHTML = '<input type="text" style="width: 100; height: 20; font-size : 10; background-color:ECECEC;" name="depapt2" value="" onChange="javascript:this.value=this.value.toUpper Case();" tabindex=2>';
    ariapt2.innerHTML = '&nbsp;<input type="text" style="width: 100; height: 20; font-size : 10;" name="ariapt2" value="" onChange="javascript:this.value=this.value.toUpper Case();" tabindex=2>';
    document.fexp.retdtbt.style.visibility="visible"
    document.fexp.rettm.disabled=false;
    document.fexp.retdt.disabled=false;
    }
    else
    {
   document.fexp.openjaw.checked=false
     newtabledata.innerHTML = '';
     newtabledata2.innerHTML = '';
     depapt2.innerHTML = '';
     ariapt2.innerHTML = '';
    }
}
-->
</script>

=============================

depapt2 is the textbox i want to be greyed out....

any ideas?

  #5 (permalink)  
Old January 21st, 2005, 07:52 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

When the textbox is disabled,text color will be changed to grey not the backcolor.You can set the background color of the textbox when it is disabled using BackColor="Gray".

  #6 (permalink)  
Old January 21st, 2005, 09:46 PM
Friend of Wrox
 
Join Date: Dec 2004
Location: Chennai, Tamil nadu, India.
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Is this what you want?

<html>
<head>
   <style type="text/css">
      INPUT.Enabled {background-color: #ffffff}
      INPUT.Disabled {background-color: #a9a9a9}
   </style>

<script type="text/javascript">
function getObject(objectId)
{
 if (document.all && !document.getElementById)
 {
    return document.all(objectId)
 }
 else
 {
    return document.getElementById(objectId)
 }
}

function DisableTextBox()
{
 getObject("txtTest").disabled=true;
 getObject("txtTest").className="Disabled";
}

function EnableTextbox()
{
 getObject("txtTest").disabled=false;
 getObject("txtTest").className="Enabled";

}
</script>
</head>

<body>
 <form>
   <input name="txtTest" class="Required" tabindex="2" value="Vadivel">
   <input type="button" value="Editable TextBox" onclick="EnableTextbox()"/>
   <input type="button" value="Disable TextBox" onclick="DisableTextBox()"/>
 </form>
</body>
</html>

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
  #7 (permalink)  
Old January 24th, 2005, 05:16 AM
Friend of Wrox
Points: 7,425, Level: 36
Points: 7,425, Level: 36 Points: 7,425, Level: 36 Points: 7,425, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,524
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

this does the trick:

<input type="radio" name="oneret" value="O" onClick="disaridt();displayOpenJaw('oneret'); this.form.retdt.disabled=true; this.form.retdt.style.background='ECECEC';">



 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic change of style rajesh_css Javascript 3 October 10th, 2008 04:45 AM
Change Drop down Border style ismailc XSLT 2 December 10th, 2007 06:25 AM
Change C# application Visual Style niting85 .NET Framework 2.0 0 April 30th, 2007 03:27 AM
change style.backgroundColor the reset all others crmpicco Javascript How-To 2 September 29th, 2005 09:52 AM
Change style attribute of a WebUserControl YiannisF ASP.NET 1.0 and 1.1 Basics 1 July 10th, 2004 02:19 PM



All times are GMT -4. The time now is 12:18 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.