skyrun
Active Member
i am using the info in this post to create a neat modal form when someone selects an option on my list.
http://fabrikar.com/forums/index.ph...ith-javascript-popup-modal.48041/#post-249989
you mention there are many options. is there documentation about what options are available?
my specific questions are how to return an error to the modal on the (modal) form plugin when it is submitted. the normal approaches for returning errors to a form seem to show 'validation error' on the top and show the error in a tooltip vs. on the item.
View attachment 17356
this is when i send on the form plugin:
and upon success (not return false an override 'success message' is specified on the form, however a message in a .js alert box always shows 'Record added/update'.
there seems to be json being returned that looks like this:
if return false/error: {"modified":[],"errors":{"___new":["There is already a template with this name. Choose another name or update that template."]}}
on success: {"msg":"Record added\/updated","url":"https:\/\/testlocation.skyrun.com\/skytrax-manage\/new-work-order?resetfilters=0&clearordering=0&clearfilters=0","baseRedirect":true,"rowid":"213","suppressMsg":false}
so it's really close, but i am wanting the form error messages to work in a similar way to the error messages on a 'normal' form (is this the format=partial? is there another template that comes into play?).
and i would like to be able to change the msg on success too.
http://fabrikar.com/forums/index.ph...ith-javascript-popup-modal.48041/#post-249989
you mention there are many options. is there documentation about what options are available?
my specific questions are how to return an error to the modal on the (modal) form plugin when it is submitted. the normal approaches for returning errors to a form seem to show 'validation error' on the top and show the error in a tooltip vs. on the item.
View attachment 17356
this is when i send on the form plugin:
PHP:
$formModel->errors['___update'][] = 'Must select an existing template or type a new name below.';
$formModel->getForm()->error = "Sorry, that's not going to work.";
return false;
and upon success (not return false an override 'success message' is specified on the form, however a message in a .js alert box always shows 'Record added/update'.
there seems to be json being returned that looks like this:
if return false/error: {"modified":[],"errors":{"___new":["There is already a template with this name. Choose another name or update that template."]}}
on success: {"msg":"Record added\/updated","url":"https:\/\/testlocation.skyrun.com\/skytrax-manage\/new-work-order?resetfilters=0&clearordering=0&clearfilters=0","baseRedirect":true,"rowid":"213","suppressMsg":false}
so it's really close, but i am wanting the form error messages to work in a similar way to the error messages on a 'normal' form (is this the format=partial? is there another template that comes into play?).
and i would like to be able to change the msg on success too.