[CLOSED] Mask in mandatory field isnot activating

  1. #1

    [CLOSED] Mask in mandatory field isnot activating

    I have a formpanel with a textfield with a mask, this field has the tag allowblank=false.

      <ext:Window 
            ID="wndU" 
            runat="server" 
            Icon="User" 
            Title="Usuario"
            Width="475" 
            Height="480" 
            AutoScroll="true"
            AutoShow="false" 
            Modal="true" 
            Hidden="true">
            <Items>
                <ext:FormPanel 
                    ID="frmU" 
                    runat="server" 
                    BodyPadding="5">
                    <Defaults>
                        <ext:Parameter Name="MsgTarget" Value="side" />
                    </Defaults>            
                    <Items>
                        <ext:Hidden runat="server" ID="x" Text="0" />
                        <ext:TextField runat="server" FieldLabel="Cuenta" ID="tU" Name="tu" AllowBlank="false" MaxLength="25" EnforceMaxLength="true" AnchorHorizontal="70%" FieldCls="bygl"/>
                        <ext:SelectBox
                            ID="cPer"
                            runat="server" 
                            Fieldlabel="Perfil" 
                            DisplayField="Descripcion"
                            ValueField="Id"
                            Name="cper" FieldCls="bygl"
                            EmptyText="Selecciona..." 
                            AllowBlank="false">
                            <Store>
                                <ext:Store runat="server">
                                    <Model>
                                        <ext:Model runat="server" IDProperty="Id">
                                            <Fields>
                                                <ext:ModelField Name="Id" />
                                                <ext:ModelField Name="Descripcion" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>            
                                </ext:Store>    
                            </Store>    
                        </ext:SelectBox>
                        <ext:TextField runat="server" FieldLabel="Nombre" ID="tN" Name="tn" AllowBlank="false" MaxLength="100" EnforceMaxLength="true" FieldCls="bygl"/>
                        <ext:TextField runat="server" FieldLabel="Password" ID="tP" Name="tp" InputType="Password" FieldCls="bygl"/>
                        <ext:TextField runat="server" FieldLabel="Email" ID="tE" Name="te" Vtype="email" AllowBlank="false" MaxLength="50" EnforceMaxLength="true" FieldCls="bygl"/>
                        <ext:TextField runat="server" FieldLabel="TelCasa" ID="ttH" Name="tth" MaxLength="13" EnforceMaxLength="true" AllowBlank="false" FieldCls="bygl">
                            <Plugins>
                                <ext:InputMask runat="server" Mask="(999)999-9999" />
                            </Plugins>
                        </ext:TextField>
                        <ext:TextField runat="server" FieldLabel="TelCelular" ID="ttC" Name="ttc" MaxLength="13" EnforceMaxLength="true" AllowBlank="false" FieldCls="bygl">
                            <Plugins>
                                <ext:InputMask runat="server" Mask="(999)999-9999" />
                            </Plugins>
                        </ext:TextField>
                        <ext:Checkbox ID="chkD" runat="server" FieldLabel="DeviceAny" Name="ckd" />
                        <ext:TextField runat="server" FieldLabel="DeviceSerial" ID="tS" Name="ts" MaxLength="50" EnforceMaxLength="true" FieldCls="bygl"/>
                        <ext:TextArea runat="server" FieldLabel="Comentario" Height="50" ID="tC" Name="tc"  Width="300" FieldCls="bygl"/>
                        <ext:Checkbox ID="chkU" runat="server" FieldLabel="Activo" Name="cku" />
                        <ext:FieldSet runat="server" Collapsed="false" Collapsible="false" Title="Actualizacion" Width="280" Border="false" Cls="cb fs9">
                            <Items>
                                <ext:Label ID="lfU" runat="server" Name="lfu" Cls="cgr fs9" />
                                <ext:Label ID="luU" runat="server" Name="luu" Cls="cgr fs9"/>
                            </Items>
                        </ext:FieldSet>
                    </Items>
                    <Buttons>
                        <ext:Button runat="server" Text="Nuevo" Icon="Add">
                            <DirectEvents>
                                <Click OnEvent="btnUNew"> 
                                    <EventMask ShowMask="true" Msg="Procesando Informacion..." />
                                </Click>
                            </DirectEvents>
                            <Listeners>
                                <Click Handler="top.GApp.wndHdr(#{wndU},1);" />
                            </Listeners>
                        </ext:Button>
                        <ext:Button id="btnG" runat="server" Icon="DatabaseSave" Text="Guarda">
                            <DirectEvents>
                                <Click OnEvent="frmUSave" before="return #{frmU}.isValid();" Success="#{grdU}.store.reload()">
                                    <ExtraParams>
                                        <ext:Parameter Name="values" Value="#{frmU}.getForm().getValues()" Mode="Raw" Encode="true" />
                                    </ExtraParams>
                                    <EventMask ShowMask="true" Msg="Procesando Informacion..." />
                                </Click>                        
                            </DirectEvents>
                        </ext:Button>
    I popup the formpanel and fill some of the fields, and try to save them, the form doesnt concern with the red border on the masked fields that are missing from being filled. I need to be inside each of the masked fields(focus on them), for the red border activates.



    How can I solve this issue?

    Thanks in advance.
    Attached Thumbnails image001.PNG  
    Last edited by Daniil; Feb 19, 2015 at 8:02 AM. Reason: [CLOSED]
  2. #2

    And also

    And, If you remove the allowblank tag , it doesnt warning anymore(it is correct), but the button for saving the information isnot sending the ajax call. It is waiting for filling the masked inputs.
  3. #3
    Hello, @rguardado!

    Would you mind if we proceed here as in your other thread?

    Again, I couldn't run your sample, although I have spent some effort in formatting the code and integrating it to an already running window. There are a couple events that probably are part of the chain of events that trigger your error and such.

    I will though, try to give you some advices, but without being able to reproduce your issue, I really can nothing bug give guesses. Mostly inaccurate.

    Look at this example: Forms - Remote Validation. It only let the 'submit' button be available once the user has all fields correctly filled. But in this case, all validation is made server-side.

    You might be looking for some Ext.NET-sided validations for commodity. Then maybe this basic example on FormPanel Validation might be what you are looking for.

    Well, if those two examples did not clear the way for you to solve your problem, we have to rely to plan #1: running sample.

    As a reminder, the guidelines are available whenever you need here:
    - Forum Guidelines For Posting New Topics
    - More information required
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Rguardado, it might me related to: http://forums.ext.net/showthread.php...as-a-InputMask.

    Please, take a look on it. there is a workaround to overcome the issue.
  5. #5

    It works, but...

    RCN, I have downloaded the SVN version. It works, now it warnings(red border) the inputs with mask, but it treats all the inputs as it was mandatory, even if you dont have it:

            <ext:TextField ID="tTelh2" runat="server" Name="ttelh2" FieldLabel="TelCasa" Width="300" MaxLength="13" MaxLengthText="13" FieldCls="bygl">
                            <Plugins>
                                <ext:InputMask runat="server" Mask="(999)999-9999" />
                            </Plugins>
                        </ext:TextField>
    The code above warnings with the red border when you try to post (save) the form. I dont have the allowblank="false".
  6. #6
    If no value, then it doesn't match a mask. By default, it is treated as a validation error.

    You can set AllowInvalid="true" to change the default behavior.
  7. #7

    It works

    Thanks Daniil, It worked as I need ii.

Similar Threads

  1. [CLOSED] Set HTMLEditor as a Mandatory field
    By speedstepmem3 in forum 1.x Premium Help
    Replies: 2
    Last Post: Feb 12, 2015, 8:56 PM
  2. [CLOSED] mandatory field mark
    By speedstepmem4 in forum 2.x Premium Help
    Replies: 1
    Last Post: Nov 01, 2013, 11:24 AM
  3. Replies: 1
    Last Post: Apr 09, 2012, 6:03 PM
  4. [CLOSED] Mandatory Field Indicator displayed inside combobox
    By AnulekhaK in forum 1.x Premium Help
    Replies: 7
    Last Post: Jan 31, 2012, 9:12 AM
  5. Replies: 32
    Last Post: Nov 17, 2010, 1:08 PM

Tags for this Thread

Posting Permissions