Menu

#3 no client-validation support

v1.0_(example)
open
nobody
5
2010-04-14
2010-04-14
jason zhaao
No

conceivably, a wizard has multiple step. Each step has a form. The form could have client-side validation code. I have no way to attach the form-specific validation code. I did these modification to wizard.js
obj.getArea = function ( id ) {
if ($L.isObject(_areas[id])) {
return _areas[id];
}
return null;
};

Modify the onSubmit to return a value
var onSubmit = function ( area ) {
if ($L.isFunction(area.onSubmit)) {
return area.onSubmit.apply ( area, [area.values] );
}
return true;
};
Stop form submission if there is onSubmit return false;
// applying the correct event for each form...
$E.on(oForm, "submit", function (e) {
var f = this,
sName = null, uri = f.getAttribute("action",2) || area.uri,
m = (f.getAttribute('method').toLowerCase() == 'post'?'POST':'GET');
if (!onSubmit (area))
{
$E.stopEvent(e);
return;
//return false;
}

In any asynchronous loaded form, I have this script
var area=YAHOO.plugin.WizardManager.getArea("myid");
area.onSubmit=function(area, values)
{
...
};

Discussion


Log in to post a comment.

MongoDB Logo MongoDB