Results 1 to 4 of 4

Thread: cancel of onblur event when cancel the form

  1. #1
    Ext User
    Join Date
    Dec 2008
    Posts
    6
    Vote Rating
    0
      0  

    Default cancel of onblur event when cancel the form

    Hi all,

    we have a form consists of some form fields those are mandotory fields and two buttons submit and cacel.
    submit is submit the form and cancel is hide the window.
    My problem is if cursor in text field and click on cancel button first it call onblur event of the field.
    it gives thies field is required.but i want to when ever click on cancel it hides the window instead of
    field validation.


    Thanks & regards

  2. #2

  3. #3
    Ext User
    Join Date
    Dec 2008
    Posts
    6
    Vote Rating
    0
      0  

    Default sample code is here

    var formPanel = new Ext.FormPanel({
    labelWidth:70,
    name:'fileup',
    title:'Form Panel',
    defaultType:'textfield',
    labelAlign:'right',
    defaults:{autoHeight:true, bodyStyle:'padding:30px'},


    monitorValid:true,

    items: [{
    fieldLabel: 'Email ID',
    name: 'email',
    vtype:'email',
    width:200,
    allowBlank:false

    },
    {
    fieldLabel: 'Email ID1',
    name: 'email1',
    vtype:'email1',
    width:200,
    allowBlank:true

    }],
    buttons:[{
    text:'OK',
    handler: function(){
    if(formPanel.getForm().isValid()){
    //form submit code
    }


    }
    },{
    text: 'Cancel',

    handler:function(){

    newAudioWindow.hide();
    }
    }]
    });
    var newAudioWindow = new Ext.Window({
    layout:'fit',

    width:350,
    height:170,
    closable: false,
    resizable: false,
    plain: true,
    border: false,
    defaults:{bodyStyle:'padding:30px'},

    items: [formPanel]
    });
    newAudioWindow.show();
    }

    This is the code .the cursor is in email id1 text field and this field allow blank is false.then we are click on cancel then it displays this field is required but i want hide the window.

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •