[CLOSED] TextField - Change Style on Focus

  1. #1

    [CLOSED] TextField - Change Style on Focus

    I want to apply some style when text field on form panel gets focus, but somehow it is not taking into effect. The following is the code,


    <style>
            .test {
                background-image: none !important;
                /*background-color: pink;*/
                border-color: red !important;
                border: 2px solid pink;
                border-radius: 4px;
                font-size: 14pt;
                box-shadow: inset 0 1px 1px rgba(1,1,1,0.075), 0 0 8px rgba(82,168,236,0.6) ;
                
            }
        </style>
      
        <ext:FormPanel ID="frm1" runat="server" Title="Testing Form">
            <Items>
                <ext:TextField ID="t1" runat="server"  FieldLabel="First Name" FocusCls="test"  />
                <ext:TextField ID="TextField1" runat="server"   FieldLabel=" Last Name" FocusCls="test"/>            
            </Items>
        </ext:FormPanel>
    Please help me out if anyone knows.

    Thank You Again.
    Last edited by Daniil; Oct 08, 2013 at 6:44 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi @shaileshsakaria,

    Please edit the post wrapping the code in [CODE] tags. This is mentioned in these guidelines.
    Forum Guidelines For Posting New Topics
    More Information Required
  3. #3
    Thank you. But no need to create a new post, you can just edit an existing one. So, in the future please just edit an existing post rather than creating a new post.

    As for the issue, I can suggest the following solution. It is better to use the Cls property instead of the FocusCls one.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <style>
            .my-field input.x-form-focus {
                background-image: none;
                background-color: yellow;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:TextField runat="server" Cls="my-field" />
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] TextField Style/Cls
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 28, 2012, 11:21 AM
  2. [CLOSED] Set style for TextField
    By Digital.Dynamics in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 11, 2012, 2:34 PM
  3. [CLOSED] IE/Firefox Textfield padding style
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 04, 2012, 3:52 PM
  4. [CLOSED] Button focus style
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 28, 2011, 12:11 PM
  5. Focus on Textfield
    By hans4 in forum 1.x Help
    Replies: 2
    Last Post: Jul 02, 2009, 9:08 PM

Tags for this Thread

Posting Permissions