• Resolved kiero63

    (@kiero63)


    Hi,

    I have a first home made form like this

    <form method="POST" action="/test_page">
    <input type="text" name="testvar" value="">
    <input type="submit" value="SEND">
    </form>

    What I’m looking at is when the form is send on test_page the CFF fieldname2 for example take the value of the testvar variable.
    Is this possible ? Can’t find a way.

    Thanks

    https://wordpress.org/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    Your explanation is a bit confusing. So, I’m not sure if I’ve understood it correctly.

    In the test_page you have inserted a form created with our plugin, that includes the fieldname2 field, and you want to assign to this field the value of the testvar parameter received by post from the form included in your description. In this case you will need an additional field. Please, follow the instructions described below:

    1. Insert in the test_page page the form’s shortcode, and an additional shortcode to create the global variable with the value received by post:

    [CP_CALCULATED_FIELDS_VAR name="testvar" from="post"]

    2. Now, into the form, insert a “HTML Content” field, and enter as its content the piece of code:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    fbuilderjQuery('#fieldname2_1').val(testvar);
    });
    </script>

    and that’s all.
    Best regards.

    Thread Starter kiero63

    (@kiero63)

    Hi,

    You perfectly understand what I was looking at and it works great.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Insert value from a POST or a GET’ is closed to new replies.