admin管理员组文章数量:1287593
I have an Extjs form which it needs some validations like when I enter letters instead of numbers, it should alert me before I submit. direct before I enter one number in the field. How can I build that ?
I have an Extjs form which it needs some validations like when I enter letters instead of numbers, it should alert me before I submit. direct before I enter one number in the field. How can I build that ?
Share Improve this question asked Jun 22, 2013 at 7:03 NoonNoon 1,2116 gold badges21 silver badges38 bronze badges 1- Something like this? – MasterAM Commented Jun 22, 2013 at 11:49
2 Answers
Reset to default 5Try this:
onFormSubmit: function(btn, event) {
var me = this,
form = btn.up('form').getForm();
if(form.isValid()) {
//submit form
}
else alert('Invalid form');
}
buttons: [{
text: "Continue",
margin: "0 5 10 0",
handler: function () {
var getForm = this.up("form").getForm();
if (getForm.isValid()) {
code her if form is valid
} else {
Ext.MessageBox.show({
title: "ERROR-A1001",
msg: "Please fill the required fields correctly.",
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.WARNING
});
}
}
}]
本文标签: javascriptExtjs Form Validation before SubmitStack Overflow
版权声明:本文标题:javascript - Extjs Form Validation before Submit - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741241267a2364024.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论