onclick to send button

  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 86
  • Thank you received: 0

Pascal Kurmann created the topic: onclick to send button

Hallo

Ich möchte einen Onclick-Event zum Send-Button eines Formulares hinzufügen. Wo kann ich das machen?

Colette
#233788
Attachments:
  • Posts: 2109
  • Karma: 72
  • Thank you received: 269

mihaela replied the topic: onclick to send button

Hello,

I hope that we can continue in English since we don't have a German speaking support staff member at the moment.

Here is how you can do what you want.

1) Go to your form's Properties and set Include submit button to No. That will remove the default submit button.

2) Create new element of Submit button type. What you write in Value field for that button element is what will be displayed on that button in your form, so that it the place where you should put, for example, "Submit".

3) Go to Advanced properties of that submit button element and in Actionscript section set Type to Custom and mark Click as Action.

In the code area below put the following code:
function ff_submit_action(element, action)
{
    
    // PUT HERE THE CODE FOR ACTION THAT YOU WANT ON CLICK
     if(typeof bfUseErrorAlerts != 'undefined'){
     JQuery(".bfErrorMessage").html('');
     JQuery(".bfErrorMessage").css("display","none");
    }
    
    error = ff_validation(0);
    if (error != '') {
        if(typeof bfUseErrorAlerts == 'undefined'){
           alert(error);
        } else {
           bfShowErrors(error);
        }
        ff_validationFocus();
    } else
        ff_submitForm();
} // ff_submit_action

Let me know whether this works as you wanted.
If you have more questions, feel free to ask.

Regards,

Mihaela
#233791
  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 86
  • Thank you received: 0

Pascal Kurmann replied the topic: onclick to send button

Hello Mihaela

Thank you for your answer! Is this correct?

function ff_submit_action(element, action)
{

gtag('event', 'buttonklick', {'event_category': 'testdrive', 'event_label': 'formular-absenden'});
if(typeof bfUseErrorAlerts != 'undefined'){
JQuery(".bfErrorMessage").html('');
JQuery(".bfErrorMessage").css("display","none");
}

error = ff_validation(0);
if (error != '') {
if(typeof bfUseErrorAlerts == 'undefined'){
alert(error);
} else {
bfShowErrors(error);
}
ff_validationFocus();
} else
ff_submitForm();
} // ff_submit_action

Something works wrong...

Regards,
colette
#233797
  • Pascal Kurmann
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 86
  • Thank you received: 0

Pascal Kurmann replied the topic: onclick to send button

Hello Mihaela

Thank you for your answer! Is this correct?

function ff_submit_action(element, action)
{

gtag('event', 'buttonklick', {'event_category': 'testdrive', 'event_label': 'formular-absenden'});
if(typeof bfUseErrorAlerts != 'undefined'){
JQuery(".bfErrorMessage").html('');
JQuery(".bfErrorMessage").css("display","none");
}

error = ff_validation(0);
if (error != '') {
if(typeof bfUseErrorAlerts == 'undefined'){
alert(error);
} else {
bfShowErrors(error);
}
ff_validationFocus();
} else
ff_submitForm();
} // ff_submit_action

Something works wrong...

Regards,
colette
#233912
Moderators: ForumSupporttomeperica
Time to create page: 0.033 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here