As avoid erasing data when it loses focus with plugin InputMask

  1. #1

    As avoid erasing data when it loses focus with plugin InputMask

    Working with the plugin InputMask noticed that if I do not complete all formatting asking me in shaping mask TextField control to lose focus and cleaned what had been written previously. My concern is how to keep the data are not cleaned and writings.

    Click image for larger version. 

Name:	Imagen A.jpg 
Views:	170 
Size:	53.5 KB 
ID:	5218

    Ext.net 2.1


    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
         <ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
         <ext:Window 
                runat="server" 
                Width="550"
                Height="350"
                AutoHeight="true"
                Title="Input Mask"            
                Closable="false"
                Layout="Form"
                BodyPadding="5">           
                <Defaults>
                    <ext:Parameter Name="LabelWidth" Value="200" />
                </Defaults>
                <Items>
                    <ext:TextField runat="server" Note="99,999,999,999" FieldLabel="Phone">
                        <Plugins>
                            <ext:InputMask runat="server" Mask="99,999,999,999" ClearWhenInvalid="false"  AllowInvalid="false"/>
                        </Plugins>
                    </ext:TextField>
    
                    <ext:TextField runat="server" Note="(999) 999-9999?+99999" FieldLabel="All symbols after '?' are optional.">
                        <Plugins>
                            <ext:InputMask runat="server" Mask="(999) 999-9999?+99999" />
                        </Plugins>
                    </ext:TextField>
                </Items>            
            </ext:Window>  
        </form>
    </body>
    </html>
  2. #2
    Set ClearWhenInvalid=false for the plugin
  3. #3
    Quote Originally Posted by Vladimir View Post
    Set ClearWhenInvalid=false for the plugin
    Not Working property and had set as you can see in the code, there will be an error in the plugin or something else I need to configure.
    Last edited by billy; Nov 29, 2012 at 8:48 PM.
  4. #4
    AlwaysShow="true" is required if you want to use ClearWhenInvalid=false
  5. #5
    Quote Originally Posted by Vladimir View Post
    AlwaysShow="true" is required if you want to use ClearWhenInvalid=false
    Thank you very much, although I liked the animation effect to show / hide the mask when focusing and defocusing control but still is very good solution.
    Also you must set the AllowInvalid property = "true" to not show as invalid field
    Last edited by billy; Nov 29, 2012 at 9:23 PM.
  6. #6
    Hi @billy,

    Quote Originally Posted by billy View Post
    although I liked the animation effect to show / hide the mask when focusing and defocusing control but still is very good solution.
    I don't understand well what you mean here. Do you use remote validation?
  7. #7
    Quote Originally Posted by Daniil View Post
    Hi @billy,



    I don't understand well what you mean here. Do you use remote validation?
    My English is bad writing helped me so much with translate.google.com therefore ask you to forgive me and have a little patience in my comments.
    You can see in the images when there is no focus not seen the focus macara but when you can see the format of the mask, I liked the effect but what I require is not applicable because of the nature I think the plugin does not allow it, if you know if you can apply this effect would love, if you can not I'll settle Vladimir response because it is a viable solution.

    Click image for larger version. 

Name:	Imagen A.jpg 
Views:	126 
Size:	71.3 KB 
ID:	5237Click image for larger version. 

Name:	Imagen B.jpg 
Views:	177 
Size:	74.8 KB 
ID:	5238
  8. #8
    I think I got the requirement now, thank you for the explanation.

    But, really, I can't see a simple possibility to achieve it.

    As Vladimir stated, to do not lose a value on blur, a mask must be always shown.

    You could try to override the plugin to get the behavior you need, but it won't be easy for sure.

Similar Threads

  1. Replies: 6
    Last Post: Oct 13, 2011, 9:51 PM
  2. Replies: 5
    Last Post: Sep 08, 2011, 5:57 AM
  3. How to avoid saving of data if required filed not filled
    By kondareddy1984 in forum 1.x Help
    Replies: 3
    Last Post: Jun 30, 2011, 6:20 AM
  4. [CLOSED] Focus Problem in EditableGrid Plugin
    By kemalyigit in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 18, 2011, 6:00 PM
  5. [CLOSED] Grid Filter loses focus
    By mjessup in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 20, 2010, 11:53 AM

Posting Permissions