Support » Plugin: Brilliant Web-to-Lead for Salesforce » How to direct user to a different page based on selection

  • Resolved kalico

    (@kalico)


    I have a form that was generated by SF and it includes some javascript to redirect the user based on which item they select from a dropdown. It’s working fine on a form that was generated from SF, but not working on a form generated by this plugin.

    The page where it works is here. That form was generated from SF and copy-pasted into the WP page. (But I think the extra js was provided by our hired SF guru, not by the automated output of SF.) If you view source and search for /form you’ll find the js below the form.

    <script type="text/javascript" language="javascript">// <![CDATA[
    jQuery("#Campaign_ID").change(function() {
     if(jQuery(this).val()=="70130000000JlfM") jQuery("#retURL").val("http://nrocnetwork.org/nroc/nroc-algebra-1-preview-access/");
     else if(jQuery(this).val()=="70130000000JlfR") jQuery("#retURL").val("http://nrocnetwork.org/nroc/nroc-developmental-math-preview-access/");
     else jQuery("#retURL").val("http://nrocnetwork.org/nroc/");
    //alert("form will return you to: "+jQuery("#retURL").val());
    });
    // ]]></script>

    I am trying to replicate that form on this page using the Brilliant plugin. However, I cannot get the js to work. This new page is on the same multisite network as the working one, but in a different subsite with a different domain. The form alone works just fine — it transmits the data to SF just as we expect it to. But the redirect in the JS does not function — I always end up with the “success” message, no redirect. You can see a screenshot of the results in the console here.

    I have tried removing the “thank you page” URL and even the “success” message in both the form and the global settings for the plugin, but to no avail.

    I have checked and compared the script on the two pages, and checked to be sure that the plugin version of my form has the same ID and value as the working form. So far it all looks good to me. I’m hoping you can tell me what’s going wrong.

    (NOTE: The final > in the js is being changed “somehow” to & g t ;. Although that looks awful, and bugs the crap out of me, it does work just fine in practice. I have tried correcting it on the WP page, and it always converts….but the original form from which I copied the script behaves the same, and has never failed.)

    Sure hope you have a suggestion! We would really like to get this form working with some sort of redirect based on a selection. We could switch to a checkbox option or some other method, if that’s necessary. But the select dropdown is ideal because we want them to pick just one.

    Thanks in advance 🙂

    • This topic was modified 1 year ago by kalico.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to direct user to a different page based on selection’ is closed to new replies.