At the moment, when ajaxifying a form fails, the user's form may become dysfunctional.
There is only the possibility to exclude it manually from the ajaxification process.
I reckon, it would be more elegant to "fall back" to a non-ajaxified form in case of failure.
(The form would then function, even if it is not ajaxified...)
Current situation:
In the case of
success: return false -> prevents other handling from kicking in
failure: return true-> enables other handling of form
The goal is obviously to maximise the success cases, by maximising the potential handling of all kinds of forms...
I have tried embedding the code in try + catch instead, but it doesn't work... Here's the code I tried:
try {
p = _k();
var g = "get",
m = fm.attr("method");
if (m.length > 0 && m.toLowerCase() == "post") g = "post";
var h, a = fm.attr("action");
if (a && a.length > 0) h = a;
else h = currentURL;
$.rq("i");
$.rq("s", h);
if (g == "get") h = _b(h, p);
else {
$.rq("is", true);
$.rq("d", p);
}
} catch(e) { $.log("a form could not be ajaxified"); return true; };
The $.log message is never written to the console...
So now, I reckon, there ought to be some kind of validation code, instead of the
At the moment, when ajaxifying a form fails, the user's form may become dysfunctional. There is only the possibility to exclude it manually from the ajaxification process.
I reckon, it would be more elegant to "fall back" to a non-ajaxified form in case of failure. (The form would then function, even if it is not ajaxified...)
Current situation:
In the case of
return false
-> prevents other handling from kicking inreturn true
-> enables other handling of formThe goal is obviously to maximise the
success
cases, by maximising the potential handling of all kinds of forms...I have tried embedding the code in
try + catch
instead, but it doesn't work... Here's the code I tried:The
$.log
message is never written to the console...So now, I reckon, there ought to be some kind of validation code, instead of the