added w2p_target attribute in form to control the output destination

This commit is contained in:
ilvalle
2015-11-14 12:03:20 +01:00
parent a0bcd2287b
commit d883e3d84e
3 changed files with 43 additions and 19 deletions
+9 -1
View File
@@ -257,12 +257,20 @@
if(form.hasClass('no_trap')) {
return;
}
form.attr('data-w2p_target', target);
var w2p_target = $(this).attr('data-w2p_target');
if (typeof w2p_target === typeof undefined || w2p_target === false) {
form.attr('data-w2p_target', target);
} else {
target = w2p_target;
}
var url = form.attr('action');
if((url === "") || (url === "#") || (typeof url === 'undefined')) {
/* form has no action. Use component url. */
url = action;
}
form.submit(function(e) {
web2py.disableElement(form.find(web2py.formInputClickSelector));
web2py.hide_flash();