• Resolved zukenstein

    (@zukenstein)


    I want to pass field contents between forms on different pages is this possible?

    So for instance if someone enters text or a number in Form 1, fieldname23, then they open in another window a page that has Form 2 in it, I can automatically load in a field of Form 2 the entered content from Form 1, fieldname23.

    Thanks

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    Yes, that’s possible. You should insert the form B into the thank page associated to the form A, and then, into the thank you page’s content, above the form’s shortcode, insert the shortcode for results to define the default values of the fields in the form B. Please, read the following section in the plugin’s documentation:

    https://cff.dwbooster.com/documentation#populate-form-b-with-a

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Is it only possible through the thank you page as I believe this is only available in the paid version is that correct?

    Is there a way to do it in the free version? I am looking to buy but want to make sure I can do everything I need first.

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    I’m sorry, but the free version of the plugin does not include the shortcode for results or the modules to process the collected information after the form be submitted.

    If you want to play with these features before upgrading the plugin, you can visit the online demo:

    Public website:

    https://demos.dwbooster.com/calculated-fields-form/

    WordPress access:

    https://demos.dwbooster.com/calculated-fields-form/wp-login.php

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Hi So I have bought the Developer version can see how to passes the form fields to the thank you page using the submit button.

    So my questions are:

    !) is it possible to pass the field contents form A to field contents Form B if form B is just another page on the website and not the Thank you page?

    2) is it possible to have a checkbox being clicked to submit the form and still leave form A in place for the user to still view it?

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    I’ll try to answer your questions:

    Q: is it possible to pass the field contents form A to field contents Form B if form B is just another page on the website and not the Thank you page?

    A: Yes, however, you should enter the shortcode for results on the page of form B to define the default values (as you did with the thank you page). Furthermore, form A must be submitted in the same active session.

    Q: is it possible to have a checkbox being clicked to submit the form and still leave form A in place for the user to still view it?

    A: Actually, you want to collect the form’s information in the background, instead of submitting it. Please, read the following post in the plugin’s blog:

    https://cff.dwbooster.com/blog/2019/08/04/partial

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Thanks

    Ok I’ve read that and a bit lost sorry. So having activated the server side add on, I take it I need to write an equation that will collect the information in the fields in Form A then call the server side equation from a field in Form B to display it without doing anything else but open the page with Form B on it, is that right?

    So how do I form this part of the equation (from the example);

    = function($p1,$p2){return @floatval($p1)+@floatval($p2);};

    To take the content on Form A fieldname2 to Form B fieldname5?

    Sorry if I’m being slow this is all new to me!

    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    No, you are merging the answers to two different questions.

    Your first question was: how to access to the information submitted by the form A from the form B if the form B is not in the thank you page of form A. And the answer was:

    You need to do the same you did with the thank you page but on the page where form B is inserted. You should insert the shortcode for results into the page where the form B is, and the form A must be submitted in the same session. The process would be similar to the example in the plugin’s documentation:

    https://cff.dwbooster.com/documentation#populate-form-b-with-a

    Your second question was: How to collect the information entered by the user through the form A, but without submitting it? I’ve recommended you to use a server-side equation to collect in the background the information entered by the user:

    https://cff.dwbooster.com/blog/2019/08/04/partial

    However, using the server-side equation to collect the information the form is not submitted, and you cannot access this information from form B.

    So, the alternative to submit the form A without navigate to the thank you page would be different:

    * Insert a “HTML Content” field in the form A, and enter the following piece of code as its content:

    
    <iframe name="silent_submission" id="silent_submission" style="display:none;"></iframe>
    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    jQuery('[id*="cp_calculatedfieldsf_pform_"]').attr('target', 'silent_submission').on('submit', function(){
    setTimeout(function(){jQuery('.cff-processing-form').remove();}, 3000);});
    });
    </script>
    

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Hi thanks for that, first question I think I’m ok with now.

    Second question I put the code you gave me into a html field in the first Form A entered an amount in 2 fields, still had this code in page containing form B

    [CP_CALCULATED_FIELDS_RESULT]
    <PRE style="display:none;"><SCRIPT>
    cpcff_default = { 1 : {} };
    cpcff_default[1][ 'fieldname3' ] = '<%fieldname1_value%>';
    cpcff_default[1][ 'fieldname7' ] = '<%fieldname2_value%>';
    </SCRIPT></PRE>
    [/CP_CALCULATED_FIELDS_RESULT]

    For form A, submit button turned off in settings, thank you page url set, but when I enter figures in form A fieldname1 and fieldname2 nothing shows up when I open the page with form B in it. Have I left something out?

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    You must submit the form A in some way. The code I recommended to enter into the “HTML Content” field is only to prevent the page with the form “A” navigates when it is submitted. You must understand the form “A” need to be submitted, or their values could not be read on the page with the form B.

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Thanks for the reply are you always working? lol

    So is it possible to have a way of submitting the page when a checkbox is checked?

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    Assuming the checkbox field is the fieldname1 (it is hypothetical, you should use the correct field’s name in your form), you can insert an “HTML Content” field in the form with the following piece of code as its content:

    
    <script>
    jQuery(document).on('change', '[id*="fieldname1_"]', function(){
    if(this.checked) jQuery(this.form).submit();
    });
    </script>
    

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Thank you so much! that has sorted it.

    Thread Starter zukenstein

    (@zukenstein)

    Sorry just realised this part you said earlier isn’t keeping the page with Form A open on submit, it is just opening the page with form B in the same window and closing the form A page.

    So, the alternative to submit the form A without navigate to the thank you page would be different:

    * Insert a “HTML Content” field in the form A, and enter the following piece of code as its content:

    <iframe name="silent_submission" id="silent_submission" style="display:none;"></iframe>
    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    jQuery('[id*="cp_calculatedfieldsf_pform_"]').attr('target', 'silent_submission').on('submit', function(){
    setTimeout(function(){jQuery('.cff-processing-form').remove();}, 3000);});
    });
    </script>
    Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    Please, send me the link to the page where you have inserted the form A. If you have included the recommended piece of code in the form, it will be submitted, but the page does not navigate.

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Hi This is a link to the page Ive set up to show you. It actually doesn’t go to the next page at all in this instance. Even if I put a submit button in instead of using the checkbox to submit. On my main page it was redirecting but not keeping the original page with form A, strange…

    https://www.81b.co.uk/sendtest/

    Thanks

    • This reply was modified 4 years, 3 months ago by zukenstein.
Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Pass field content between forms on different pages’ is closed to new replies.