[CLOSED] InputMask plugin

  1. #1

    [CLOSED] InputMask plugin

    Last edited by Baidaly; Jul 26, 2013 at 10:42 PM. Reason: [CLOSED]
  2. #2
    Hello!

    Please, read the following post: http://forums.ext.net/showthread.php...l=1#post104436
  3. #3
    Hi,

    Yes, in this case he wanted to force the filling, in my case I do not.
    In my scenario the user can leave the field empty.
    Is there some setting?

    Guess I'll have to validate all form fields (foreach) manually.

    Thanks!
  4. #4
    Try the following overriding:

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server"></ext:ResourceManager>
            
            <script>
                Ext.override(Ext.net.InputMask, {
                    getErrors: function () {
                        var field = this.getCmp(),
                            errors = this.fieldGetErrors.call(field, field.processRawValue(field.getRawValue()));
    
                        if (errors.length == 0 && field.getRawValue().length == 0 && field.allowBlank)
                            return errors;
    
                        if (!this.isValueValid()) {
                            errors.push(this.invalidMaskText || field.invalidText);
                        }
    
                        return errors;
                    },
                });
            </script>
    
            <ext:FormPanel runat="server" ID="FormPanel1">
                <Items>
                    <ext:TextField ID="TextFieldTelefoneFixo" runat="server" FieldLabel="Telefone fixo" AllowBlank="true" MsgTarget="Side">
                        <Listeners>
                            <Change Handler=""></Change>
                        </Listeners>                       
                        <Plugins>
                            <ext:InputMask ID="InputMaskTelefoneFixo" runat="server" Mask="(99) 9999-9999" InvalidMaskText="Formato incorreto">
                                <CustomConfig>
                                </CustomConfig>
                            </ext:InputMask>
                        </Plugins>
                    </ext:TextField>
                </Items>
                <Buttons>
                    <ext:Button ID="BotaoSalvarUsuario" runat="server" Text="Salvar" Icon="DiskBlack">
                       <Listeners>
                           <Click Handler="
                                Ext.Msg.alert(#{FormPanel1}.getForm().isValid().toString());
                               "></Click>
                       </Listeners>
                   </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </form>
    </body>
    </html>
  5. #5
    Hi Baidaly,

    Please, close this thread.

    Thanks for the solution.

Similar Threads

  1. What values can I use in the InputMask Plugin?
    By KBorkiewicz in forum 2.x Help
    Replies: 2
    Last Post: Mar 26, 2013, 1:32 AM
  2. [CLOSED] InputMask JS error
    By stratadev in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 13, 2013, 4:27 PM
  3. [CLOSED] InputMask
    By sigmasafi in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 28, 2013, 4:08 AM
  4. How to add an InputMask plugin?
    By joaxazevedo in forum 2.x Help
    Replies: 3
    Last Post: Feb 21, 2013, 8:28 PM
  5. Replies: 7
    Last Post: Dec 05, 2012, 6:11 AM

Tags for this Thread

Posting Permissions