Nov 21, 2013, 12:41 PM
[CLOSED] Ext.Net webforms validation summary
Hi,
I have a webform having ext.net controls seperated in different tabs. Each tab is rendered via a user control (.ascx) file.
I would like to add a validation summary to display client side validation errors. The submit button automatically checks if there is any client side valiation error and prevents the form to be submitted. However, the controls are in different tabs so it is not easy to find where is the client side error.
Is there anyway to iterate through all controls in the webform, check if it has an error and collect the error messages for those controls? Alternatively, if there is any existing validation summary control then it would be helpful too. I tried ValidationStatus plug-in but it only validates a single form while in my case there are multiple FormPanels within the web page.
Update:-->
I found a way to iterate through all Form Panel and check if it is valid or not.
Many thanks.
I have a webform having ext.net controls seperated in different tabs. Each tab is rendered via a user control (.ascx) file.
I would like to add a validation summary to display client side validation errors. The submit button automatically checks if there is any client side valiation error and prevents the form to be submitted. However, the controls are in different tabs so it is not easy to find where is the client side error.
Is there anyway to iterate through all controls in the webform, check if it has an error and collect the error messages for those controls? Alternatively, if there is any existing validation summary control then it would be helpful too. I tried ValidationStatus plug-in but it only validates a single form while in my case there are multiple FormPanels within the web page.
Update:-->
I found a way to iterate through all Form Panel and check if it is valid or not.
var ValidateForm = function () {
var valid = true;
var dom = Ext.getBody();
Ext.each(Ext.get(dom).query('div.extFormPanel'), function (dom) {
var cmp = Ext.getCmp(dom.id);
if (cmp && cmp.isVisible()) {
valid = cmp.getForm().isValid() && valid;
}
});
return valid;
}
Is there anyway to get the error message as well? Many thanks.
Last edited by Daniil; Nov 22, 2013 at 3:18 PM.
Reason: Please use [CODE] tags, [CLOSED]