Cancel button action

  • ldor
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

ldor created the topic: Cancel button action

Hi

I selected "Include cancel button" in my form. The button is there but nothing happens when I press it. And I cannot find a way to assign an action to this button. I would like it to redirect to the Home Page. How can I do that?

In fact, I have a similar question for the Submit button too. The Submit button works, it executes my custom php script. But the form remains on the screen, whereas I would like it to redirect to the Home Page after the script is executed. I could do the redirection in my script but is there a way to do it in the form itself?
#234809
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 1938
  • Karma: 67
  • Thank you received: 234

mihaela replied the topic: Cancel button action

Hello,

I will first explain the part about redirecting after submit.

In the End Submit piece you can put code to redirect your form to the URL that you want as explained here crosstec.org/en/support/online-documenta...-thank-you-page.html .

As for the cancel button, when you click on that button by default you should stay on the same page and form values should be reset.

What you could do to add functionality that you want to that button is you could set "Include cancel button" to "No".

Then you would create a custom cancel button.

Here are instructions how to so to.

1) Create new element of "Submit button" type. Let's say that you name it "cancelButton" .What you write in Value field for that button element is what will be displayed on that button in your form, so that is the place where you should put, for example, "Cancel".

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

In the code area below put the code similar to this one:
function ff_cancelButton_action(element, action)
{
eval('document.'+ff_processor.form_id).reset();
location.href="https://www.google.com/";
} // ff_cancelButton_action
NOTE: You have to replace " www.google.com/ " with the URL that you wish to redirect to. Also, in order for this to work, "cancelButton" has to be the exact name of the button.

I will just note that if you want, you could create a custom button to submit the form as well in similar way if you want. Of course, you would have to use different code for actions that you want and to submit the form.

Let me know whether you have managed to make this work for your form as you wanted.

Regards,

Mihaela
#234810
  • ldor
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

ldor replied the topic: Cancel button action

Dear Mihaela,

Thank you very much. Now I see, the Cancel button clears the form. That's fine then. I did not realize that before, I was thinking it has no action. As for the Submit button, I've included redirection in my custom script, so it's also done.

May I ask a different question in the same thread?
Why does the Calendar button look distorted like this? (I've attached a screenshot). Is it because of my template or something else? I am using aqua theme here. But the button appears distorted with most of the themes. With some themes, e.g. the default theme, it looks all right but I don't like something else about those themes, so don't want to use them.
#234811
Attachments:
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 1938
  • Karma: 67
  • Thank you received: 234

mihaela replied the topic: Cancel button action

Hello again,

I'm glad that the Submit and Cancel button issues are resolved.

As for the Calendar button not working properly, the simplest solution for this is to change element type form "Calendar" to "Responsive Calendar".

Let me know whether that solution is acceptable for you.

Regards,

Mihaela
#234820
Moderators: ForumSupporttomeperica
Time to create page: 0.177 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