options for modal-ly displayed form

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:
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.
 
I would like them the same as if the form was displayed on a full webpage.

I meant tooltip is how they display now perhaps instead of pop-up.


Sent from my iPhone using Tapatalk
 
Yup, just checking I understood correctly.

That's on my (admittedly rather long) list of Things To Do When I Get A Few Hours.

Rob wrote that feature for validation errors in an AJAX popup, and I've never really liked it. But, quite rightly, he said "if you don't like it, write something different", lol. And the code isn't trivial, whichever way you do it. The problem Rob was working round was the rather inelegant way inline error messages move the form's DOM around when inserted on an AJAX response. But personally, I'd rather have that happen than deal with popup tooltip style error msgs.

So ... it's definitely on my list, to at least make that behavior optional. But it's not a trivial change.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top