Adding a loader gif/image on submit

alisamii

Member
How do I add a loader gif/image to a form when the user clicks submit.

I need some form of indicator that let's the user know that their form submission is in process, especially when there are uploading a file. Currently, when the user clicks submit, there is no visual indication that something is happening on the form until they get the thank you page.

Ideally, I would like to have a spinner/loader image to overlay the page until the submit is complete.

Thanks,
 
OK ... if you don't have one already create a JS file for your form, in ./components/com_fabrik/js/form_X.js, where X is your numeric form ID.

In that file ...

Code:
window.addEvent('fabrik.loaded', function () {
    Fabrik.addEvent('fabrik.form.submit.start', function (form, e, btn) {
        Fabrik.loader.start(form.getBlock());
        return true;
    });
});

... should put up our standard loader overlay for the form when the submit button is clicked.

-- hugh
 
This is great, is there any way this could be standard with Fabrik?

This has been on my request list for a while, just never got around to asking about it yet, alisamii beat me to it,:)
 
Anything *could* be standard with Fabrik, up to and including becoming self aware and taking over the planet. It's more a case of being careful about not over-featurizing, as we have so many options and settings, we tend to be very wary about adding more. Fabrik has suffered from "creeping featurism" (or as I prefer to call it, "feeping creaturism") over the years.

But I'll look at adding this as an option, as it's something I've ended up doing quite a few times, and agree that having some indication that "something is happening" when uploading large files is a good idea.

-- hugh
 
The USA and many 1st world countries have the luxury of blindingly fast internet connections, whereby one does not even notice tasks takinging a while.

Here in South Africa and many other countries, we are slow to catch up. Until recently our average connection was 500kbit/s upload and 1mb/sec download, so uploading a 16mbyte file mostly took more than 5-6 minutes.

This will go a long way to stop those many client support calls, complaining the system has stopped.......;)

If this option is in the form, we can then cover all our bases.

Paul
 
Good point.

OK, I'll just check with The Boss, as we kind of have an agreement that we won't unilaterally add YAFO (Yet Another Option) without consulting the other person ...

-- hugh
 
I think thats a valid thing to add in, the form's 'form processing' section makes sense to me as a good location to put the option
 
I pledge for this one too.
Also it's better to have it built in in th JS instead of having yet another extra JS file to add to the bunch (an extra http call).
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top