• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

disable submit in pagination

I want to disable the submit button in a multi-page form so that it only appears on the last page. I assume I can do something like
if(document.getElementById('page_3').disabled || $('#page_3:hidden').length == 0)
then display the button
else hide the button

But where is the best place to do this? Where is the JS that is executed on each page load in a multi-page form?

Thanks!
Shawn
 
I figured it out.. in your js folder add a form_X.js file and use these event handlers:

Fabrik.addEvent('fabrik.form.page.change.end', function (form, dir) {
Fabrik.addEvent('fabrik.form.elements.added', function(form, dir){

Then you can control the button with
submit.disabled = "true";
submit.setStyle('opacity', 0);

For anyone that needs this:

Fabrik.addEvent('fabrik.form.page.change.end', function (form, dir) {

var submit = form._getButton('Submit');
submit.disabled = "";
submit.setStyle('opacity', 1);

/* hide submit except on page 3 */

if (form.currentPage < 3) {
submit.disabled = "true";
submit.setStyle('opacity', 0);
}
});

Fabrik.addEvent('fabrik.form.elements.added', function(form, dir){
var submit = form._getButton('Submit');
submit.disabled = "";
submit.setStyle('opacity', 1);

/* hide submit on first page .. this is first load above is for page change */
submit.disabled = "true";
submit.setStyle('opacity', 0);
});

And that should do it
 

Members online

No members online now.
Back
Top