[CLOSED] AllowBlank="false" prevent formpanel to submit on the front?

  1. #1

    [CLOSED] AllowBlank="false" prevent formpanel to submit on the front?

    although I set AllowBlank="false" to the textfield property , but textfield is blank and click the button , the process run to the server code.
    how to prevent to run to server when textfield is blank.
    <ext:FormPanel
                                        ID="w_login"
                                        runat="server"
                                        Closable="false"
                                        Resizable="false"
                                        Title="用户登陆"
                                        Draggable="false"
                                         
                                         DefaultButton="btnLogin" Layout="VBoxLayout">
                                         
                                        <Items>
                                            <ext:TextField
                                                ID="txtUsername"
                                                runat="server"
                                                FieldLabel="用户名" LabelAlign="Right"
                                               
                                                AllowBlank="false"
                                                BlankText="请输入用户名">
                                                <Listeners>
                                                    <AfterRender Handler="#{txtUsername}.focus(false,200);">
                                                    </AfterRender>
                                                </Listeners>
                                            </ext:TextField>
                                            <ext:TextField
                                                ID="txtPassword"
                                                runat="server"
                                                InputType="Password" LabelAlign="Right"
                                                FieldLabel="密码"
                                                AllowBlank="false"
                                                BlankText="请输入密码" />
                                        </Items>
                                        <Buttons>
                                            <ext:Button ID="btnLogin" runat="server" Text="登陆" Icon="DoorIn">
                                                <DirectEvents>
                                                    <Click OnEvent="btnLogin_Click">
                                                        <EventMask ShowMask="true" Msg="正在验证..." MinDelay="500" />
                                                    </Click>
                                                </DirectEvents>
                                            </ext:Button>
                                        </Buttons>
    </ext:FormPanel>
    Last edited by Daniil; May 16, 2013 at 3:39 AM. Reason: [CLOSED]
  2. #2
    Hi @hdsoso,

    Please set up
    FormBind="true"
    for the Button.

    It disables a Button if a FormPanel is invalid.
    http://docs.sencha.com/extjs/4.2.0/#...t-cfg-formBind

Similar Threads

  1. [CLOSED] AllowBlank="false" problem when reopen the window
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 08, 2013, 11:30 AM
  2. Replies: 0
    Last Post: Aug 28, 2012, 5:05 PM
  3. TextBox wit AllowBlank="False" and VType
    By inaltec in forum 1.x Help
    Replies: 2
    Last Post: Jul 25, 2012, 4:42 PM
  4. [CLOSED] DropDownField with AllowBlank="false" issue
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 23, 2011, 11:56 AM
  5. Replies: 3
    Last Post: Dec 15, 2010, 2:07 PM

Posting Permissions