• Resolved shawnm1

    (@shawnm1)


    Where can I learn how to pass information to the form?
    For example:
    User on page A can click a variety of buttons. Clicking any of them leads to the same form, but the buttons pass different variables to the form, which activate different conditional logic.

    I saw in the manual that the form can pass information to another page, but is the reverse possible, where the form can accept information from another page?

Viewing 1 replies (of 1 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    There is no tutorial for it (i will work in create one) but it can be done like this:

    1.- Configure your first form to redirect to the second form passing the parameters that you need: https://sfmanual.rednao.com/documentation/other-features/send-users-to-another-page-and-pass-form-information-to-it/

    2.- In your second form create a formula conditional logic (section 3 of https://sfmanual.rednao.com/documentation/conditional-logic/doing-calculations-in-conditional-logics/) this formula is kind of complex first it needs to have this piece of code:

    function gup( name ) {
    var url = location.href;
    name = name.replace(/[\[]/,”\\\[“).replace(/[\]]/,”\\\]”);
    var regexS = “[\\?&]”+name+”=([^&#]*)”;
    var regex = new RegExp( regexS );
    var results = regex.exec( url );
    return results == null ? null : results[1];
    }

    This code will help you read the parameters that you passed in your first form.

    Then you can read the parameters like this (assuming that you passed the value of the field with id ‘rnfield1’):
    gup(‘rnField1’)

    So for example, if you want to show a field only when the value of the field rnField1 is ‘show’ you would use a furmula like this:

    function gup( name ) {
    var url = location.href;
    name = name.replace(/[\[]/,”\\\[“).replace(/[\]]/,”\\\]”);
    var regexS = “[\\?&]”+name+”=([^&#]*)”;
    var regex = new RegExp( regexS );
    var results = regex.exec( url );
    return results == null ? null : results[1];
    }

    return gup(‘rnField1′)==’show’;

    Here is an example of a form that has a ‘Show/hide’ conditional logic that uses this method: https://send.firefox.com/download/8d660afb06/#3HDMRVjfwDCMfO7XRUFsag

    Regards!

Viewing 1 replies (of 1 total)
  • The topic ‘Pass info to Form’ is closed to new replies.