PDA

View Full Version : FormPanel with card layout



spbroom
25 Oct 2010, 2:42 AM
I am implementing a wizard using a form with a cad layout. I'd like to be able to alert the use to missing/invalid data every time they click "next".

I am pretty sure I can do this by looping over all of the form's fields and check what panel it is in and then if any fields in the current panel have invalid data cancel the next action and alert them to the fact.

But, I'd like to be able to do it the other way around, for each panel, find out what fields are in it and check those.

Is this possible?

Thanks

Condor
25 Oct 2010, 3:15 AM
var valid = true;
panel.cascade(function(c){
if(c.isFormField) {
valid = valid && c.isValid();
}
});

spbroom
25 Oct 2010, 3:25 AM
Thanks a million