• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

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