Cancel Button, Go to site Home page

  • Gilles361
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 185
  • Thank you received: 5

Gilles361 created the topic: Cancel Button, Go to site Home page

Hi,
I've a multiple (4) pages BF, with Submit / Cancel buttons, and a thanks page. My users need to connect before seeing BF form. My BF form submits OK, but :

When pressing CANCEL, I've no action? (stay on "submit" page)
1/ How to fix this?
2/ I would like CANCEL butt on, to go to my site home page (SSL - URL : www.mysite.com ). How to do so?

Thanks, Gil
#234257
  • Posts: 2645
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Cancel Button, Go to site Home page

Hello,

Are you using the default cancel button that you have activated by pressing "Include cancel button" in form properties?
1) If that is the case, then when clicking on it the form's values should be reset, but you will stay on the last page of the form.
Is it behaving that way, but you want additional action or the button isn't working?

2) You could create a custom Cancel button on the last page of your form. Follow this steps:
1. Set "Include cancel button" to "No".

2. Create a new element of Type "Submit button" on the last page of your form named "cancel".

3. Go to the Advanced properties of that newly created element and in the Actionscript section set Type to Custom and Action to Click.

In the code area below put the following code:
function ff_cancel_action(element, action)
{
  eval('document.'+ff_processor.form_id).reset();
  window.location.href = "https://www.google.com/";
 
} // ff_cancel_action
NOTE: In the code above put the URL of your site's home page instead of www.google.com/ .

Let me know whether it works as you wanted.

Regards,

Mihaela
#234270
  • Gilles361
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 185
  • Thank you received: 5

Gilles361 replied the topic: Cancel Button, Go to site Home page

Thanks Mihaela,
for help in "Action"
I've had to create two elements as Submit was coming below Cancel...
Now both buttons are in Left side. (see attached png)

1/ Is there a way to have them both on right side?

2/ How to have a "Submit Button" element on right or left side of a form?
#234280
Attachments:
  • Posts: 2645
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Cancel Button, Go to site Home page

Hello,

You can set the position of submit buttons with some css code in Before Form pieces.

Go to your form > Advanced tab > More options > Form pieces > Before Form > Type > Custom and paste this code:
echo '
<style>
.bfQuickMode .bfSubmitButton
{
      float: left !important;
      position: relative !important;
      left: 45% !important;
}
</style>
';
This will set the position for the regular Submit button. This is an example of the code that would center it.

As for the custom submit buttons, you can set the position for each one by inspecting it's ID and using code similar to the code above or something like this:
echo '
<style>
#ff_elem195
{
      float: right !important;
      position: relative !important;

}
</style>
';
That will place the element with the id "ff_elem195" to the right.

Let me know whether you've managed to position the buttons as you wanted.

Regards,

Mihaela
#234320
  • Gilles361
  • Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 185
  • Thank you received: 5

Gilles361 replied the topic: Cancel Button, Go to site Home page

Hi Mihaela,
Based on your scritp, I've created a "GN_Cancel" script to do so, as I've multiple pages that require this button function. It works fine...

From above script, I've to hard code my "HOME PAGE".
1/ Is there a way to find my home page, and automatically and pass it?
inside my "GN_Cancel" script
#234452
  • Posts: 2645
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Cancel Button, Go to site Home page

Hello,

Great idea for crating a "GN_Cancel" script in your case.

Please try using the following solution to redirect to the home page:
window.location.href="../index.html"

Let me know whether it worked.

Regards,

Mihaela
#234465
Moderators: ForumSupporttomeperica
Time to create page: 0.066 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription 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 for just 49! (Summer Sale)

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

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