---
title: "How to validate from in extjs."  
description: "How to validate from in extjs."  
author: "Allen Scott"  
published: 2016-10-05  
updated: 2016-11-07  
canonical: https://www.mindstick.com/forum/34191/how-to-validate-from-in-extjs  
category: "sencha touch"  
tags: ["sencha"]  
reading_time: 2 minutes  

---

# How to validate from in extjs.

Hi Buddy\
I want to know that how to [validate](https://www.mindstick.com/forum/1490/what-is-better-solution-for-validate-form-textboxs-value) from in extjs.Please help me i would really appreciate your help.\
Thanks

## Replies

### Reply by Hubert Jason

Great descriptive answer with valid result

### Reply by Anonymous User

here i am going to validate form please see below code.

```
Ext.define('MyApp.view.UserForm', {
    extend: 'Ext.window.Window',
    xtype: 'UserForm',
    modal: true,
    layout: 'fit',
    height: 300,
    width: 400,
    title: 'UserForm',
    items: [
		{
		    xtype: 'form',
		    bodyPadding: 5,
		    items: [
				{
				    xtype: 'fieldset',
				    title: 'User Info',
				    defaults: {
				        xtype: 'textfield',
				        labelWidth: 100,
				        width: 300
				    },
				    items: [
                        {
                            name: 'UserId',
                            hidden: true
                        },
						{
						    fieldLabel: 'Name',
						    name: 'UserName',
						    sortable: true,
						    allowBlank: false,
						    msgTarget: 'side'
						},
						{
						    fieldLabel: 'Email',
						    sortable: false,
						    name: 'UserEmail',
						    allowBlank: false,
						    msgTarget: 'side'
						},
					    {
					        fieldLabel: 'Phone',
					        sortable: false,
					        name: 'PhoneNumber',
					        allowBlank: false,
					            msgTarget: 'side'

					    },
						{
						    fieldLabel: 'Address',
						    sortable: false,
						    name: 'Address',
						    allowBlank: false,
						    msgTarget: 'side'
						},
					    {
					        fieldLabel: 'Password',
					        name: 'Password',
					        sortable: false,
					        allowBlank: false,
					        msgTarget: 'side'
					    }
				    ]
				}
		    ],
		    buttons: [
				{
				    text: 'Save',
				    action: 'saveUser'
				}
		    ]
		}
    ]
});
```

```
onSaveUserClick: function (button) {
        var self = this;
        var form = button.up('form');
        if (form.isValid()) {

        }
        else {
            Ext.Msg.alert('Status', 'Please fill vailid data !', function (btn, text) { });
            return;
        }

    }
```

![How to validate from in extjs.](https://www.mindstick.com/mindstickforums/441a9011-9e96-4866-bf72-9a98867128b9/images/080c9de8-3fab-4a83-9a7a-676b8803ca8a.png)\
\
![How to validate from in extjs.](https://www.mindstick.com/mindstickforums/441a9011-9e96-4866-bf72-9a98867128b9/images/4e2d39ea-83bf-4c37-bcad-511a3bb21cbf.png)\
\
\
Thanks.


---

Original Source: https://www.mindstick.com/forum/34191/how-to-validate-from-in-extjs

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
