How to gracefully exit a form

Saumier

Member
I'm using Joomla 2.5.7 & Fabrik 3.0.6
I have a Form with a radio button - 0=No 1=Yes. If the No is clicked I want to display a message and then exit the form to the site Home Page. Been trying to get this to work for a full day now using Javascript without success. Any help is surely appreciated.
I haven't seen anything in the Wiki or Forum that has helped me.

Thanks.
 
I presume you are using a JavaScript event on the element, using the 'change' trigger.

Try this:

Code:
if (form_X.formElements.get('yourtable___yourradio').getValue() == '0') {
   alert('Your message here');
   window.location.replace('http://your.new.url/');
}

Replace X in form_X with the numeric ID of your form (the ID in the leftmost column on the main list of forms on the backend), and yourtable___yourradio with the full element name of your radio element.

-- hugh
 
Note that you could tweak that slightly to make the alert a confirm(), and reset the radio to "yes" is they cancel it, which is usually a better way to handle this so they don't lose any other form selections if they accidentally hit No.

Let me know if that's what you want to do.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top