[CLOSED] disabled textfield

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] disabled textfield

    Hi

    i am trying to make changes to css x-item-disabled class for a disabled textfield control. it works in that I can change to opacity. I am trying to change color of font from gray to some dark color like black so it can be more readable. I am using ie7 for testing but it is not working.
    any suggestions
    thanks
    idriss

    
    
    
    .x-item-disabled
    
    
    {
    
    
    filter: alpha(opacity=120) !important; 
    
    
    color: black !important;
    
    
    font-weight: bolder !important; 
    
    
    opacity: .9 !important;
    
    
    cursor: inherit !important;
    
    
    }
  2. #2

    RE: [CLOSED] disabled textfield

    Hi idriss,

    I believe IE does not allow the text color to be changed on disabled input fields. This is "feature" of the IE browser.


    I know of no way to change a disabled input fields text color in IE.


    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] disabled textfield

    thanks. I was under the same impression but was hoping when I saw the x-item-disabled class.
    idriss
  4. #4

    RE: [CLOSED] disabled textfield

    Hi,

    What about to use ReadOnly and apply own css class when toggle value of ReadOnly property?
  5. #5

    RE: [CLOSED] disabled textfield

    Hi

    ReadOnly is working except in the case of DateField. if I disable datefield, then user can not select date from datepicker. if I use ReadOnly, the user can not type anything in the text box but he is able to choose date from date picker.

    idriss
  6. #6

    RE: [CLOSED] disabled textfield

    Hi,

    Well, trigger issue can be solved with the following code.


    1. You can set empty function for trigger handle
    ReadOnly=true
    DateField1.oldTriggerClick = DateField1.onTriggerClick; DateField1.onTriggerClick = Ext.emptyFn;

    ReadOnly=false
    DateField1. onTriggerClick  = DateField1.oldTriggerClick;
  7. #7

    RE: [CLOSED] disabled textfield

    vlad

    is it this JS or code behind code. is it possible to do that in code behind. I can not find onTriggerClick.

    thanks for your help
    idriss
  8. #8

    RE: [CLOSED] disabled textfield

    Hi,

    It is javascript code. For example, you can use the following schema

    1. Set ReadOnly="true"
       DataField1.ReadOnly = true;
       DataField1.AddScript("{0}.oldTriggerClick = {0}.onTriggerClick; {0}.onTriggerClick = Ext.emptyFn;", DataField1.ClientID);
    2. Set ReadOnly="false"

    
       DataField1.ReadOnly = false;
    
       DataField1.AddScript("{0}.onTriggerClick = {0}.oldTriggerClick;", DataField1.ClientID);
  9. #9

    RE: [CLOSED] disabled textfield

    Vlad

    I have tried your suggestion but I am still able to click on calendar icon and get calendar for date picker. I was able to use jQuery to search for the img tag that follows the input date field and then set attr to disabled in the mean time.

    I do like your method better if you can think of something else.
    thanks for your help

    idriss
  10. #10

    RE: [CLOSED] disabled textfield

    Hi,

    ok, here is an example which should works
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void ReadOnlyTrue(object sender, AjaxEventArgs e)
        {
            DateField1.ReadOnly = true;
            DateField1.AddScript("{0}.trigger.un('click', {0}.onTriggerClick, {0});", DateField1.ClientID);
        }
    
        protected void ReadOnlyFalse(object sender, AjaxEventArgs e)
        {
            DateField1.ReadOnly = false;
            DateField1.AddScript("{0}.trigger.on('click', {0}.onTriggerClick, {0}, {{preventDefault:true}});", DateField1.ClientID);
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:DateField ID="DateField1" runat="server"></ext:DateField>
            
            <ext:Button runat="server" Text="ReadOnly=true">
                <AjaxEvents>
                    <Click OnEvent="ReadOnlyTrue" />
                </AjaxEvents>
            </ext:Button>
            
            <ext:Button runat="server" Text="ReadOnly=false">
                <AjaxEvents>
                    <Click OnEvent="ReadOnlyFalse" />
                </AjaxEvents>
            </ext:Button>
        </form>
    </body>
    </html>
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] CSS class for disabled TextField
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 07, 2012, 5:48 PM
  2. TextField disabled bug ?
    By xtremexploit in forum 1.x Help
    Replies: 5
    Last Post: Nov 14, 2011, 4:41 PM
  3. Click on disabled TextField - catch the event
    By AlexMaslakov in forum 1.x Help
    Replies: 1
    Last Post: Nov 14, 2011, 12:31 PM
  4. Can't read value from disabled textfield
    By Ares in forum 1.x Help
    Replies: 4
    Last Post: Jul 01, 2009, 5:33 PM
  5. [CLOSED] Getting value from disabled textfield?
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 19, 2008, 10:19 AM

Posting Permissions