• Well, I’ve been fooling around for a copple of hours with this plugin, and I like it verry much. But, I need to do one thing, but I haven’t found that option yet!. I need to connect form 1 with form 2.. Example: In form 2 I have a calculator which calculates a price. That price has percentages in it. I need to get those percentages out of form 1. Is this possible with this plugin. If yes, how?!. If not, do you know another plugin where I can connect forms with each other?!

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

    (@codepeople)

    Hi,

    Yes, you can connect forms in different pages, but in the current version of the plugin you will need to use something of additional code, please, visit the following link to our technical blog:

    http://blog.net-factor.com/how-to-use-the-data-submitted-by-a-form-in-another-one/

    and the following thread in the forum of the plugin:

    https://ww.wp.xz.cn/support/topic/link-to-a-specific-woocommerce-product-page-based-off-user-input?replies=44

    Best regards.

    Thread Starter Electroguy

    (@electroguy)

    Thanks man… You’ve been a great help!!
    I try it tomorrow, and if I have problems with it I let you know!

    Best Regards

    Plugin Author codepeople

    (@codepeople)

    Perfect

    Thread Starter Electroguy

    (@electroguy)

    I have been looking for the ‘Thank you’ page (I have version 4.3.1), but I can’t find it!! Can you send me a link, or tell me which version I need to get access to the ‘Thank you’ page?!.

    Plugin Author codepeople

    (@codepeople)

    Hi Electroguy,

    The “Thank you” page can be any page or post in your website. You simply should create a new page/post in your website, and enter the text you want in its content, and if you want to include in the thank you page a summary with the information entered by the user in the form, the shortcode:

    [CP_CALCULATED_FIELDS_RESULT]

    After create the new page/post, copy its URL, and go to the settings of the form, and enter the URL in the attribute:

    Thank you page (after sending the message)

    and save the form’s settings, that’s all.

    Best regards.

    Thread Starter Electroguy

    (@electroguy)

    So I have to get another version of the same plugin… Then I have to make 2 forms, which are located on diffrent pages.. Then I have to insert the URL of form 2 into the ‘Thank you page (after sending the message)’ field.. Then I have to add the Javascript code to the page of form 1 (in text-mode), and then I am finished?!

    Best Regards,

    Plugin Author codepeople

    (@codepeople)

    Hi,

    I will call to the forms: Form_A, and Form_B, in the thank you page of Form_A, you should insert the shortcodes:

    [CP_CALCULATED_FIELDS_RESULT]
    ....
    [/CP_CALCULATED_FIELDS_RESULT]

    Including the javascript function in the blog entry, and calling to the javascript function to populate the fields in the From_B. For example, I’ll assume you want assign the value of fieldname2 field in the Form_A, to the fieldname3 field in the Form_B, I will assume too, in this explanation, that the id of the Form_B is the number 6, so, the code in the Thank You page of Form_A would be:

    [CP_CALCULATED_FIELDS id="6"]
    [CP_CALCULATED_FIELDS_RESULT]
    <pre style="display:none;"><script>
    function setFieldValue(field, value) {
      jQuery('[id="' + field + '"]').each(
        function () {
        var e = jQuery(this),
        attr = e.attr('vt'),
        t = this.tagName;
    
        if (typeof attr == 'undefined' && t != 'SELECT') {
          e.val(value);
          if (e.hasClass('phone')) {
            value = jQuery.trim(value)
                     .replace(/[^\d]/g, ' ')
                     .split(' ');
            for (var j = 0, h = value.length; j < h; j++) {
               jQuery('[id="' + field + '_' + j + '"]').val(value[j]);
             }
           } else if (e.hasClass('date')) {
             value = jQuery.trim(value).split(' ');
             jQuery('[id="' + field + '_date"]').val(value[0]);
             if (value.length > 1) {
              var time = value[1].split(':');
              jQuery('[id="' + field + '_hours"]').val(time[0]);
              jQuery('[id="' + field + '_minutes"]').val(time[1]);
            }
          }
        } else {
          if (t == 'SELECT') {
            e.find('[vt="' + value + '"]')
             .prop('selected', true);
          } else {
            if ((typeof value == 'object' &&
                 jQuery.inArray(attr, value) != '-1') ||
                 attr == value) {
              e.prop('checked', true);
            }
          }
        }
      }).change();
    };
    
    setTimeout( function(){setFieldValue('fieldname3_1', '<%fieldname2_value%>' );}, 2000);
    </script></pre>
    [/CP_CALCULATED_FIELDS_RESULT]

    and that’s all.

    Now, you simply should to use the correct fields names, and form’s id, in your website.

    Best regards.

    Thread Starter Electroguy

    (@electroguy)

    So, I have got a new version of the plugin, and it works!!
    But I have another question for you?!
    I have a radio button box:

    Value 1
    Value 2
    Value 3
    Value 4.

    But if I select ‘Value 1’ out of those radio buttons, the Predefined value of the single line text field below needs to be ‘3,5’.
    The same goes with ‘Value 3’, but if I select ‘Value 2’, the Predefined value needs to be ‘1,5’.

    Where/how can I add a php if statement which says:
    <?php

    if(radio-button == 1 && radio-button == 3){
    predefined value == 3,5;
    }

    else {
    predefined value == 2,5;
    }

    ?>?

    Kind Regards,

    Electroguy

    Plugin Author codepeople

    (@codepeople)

    Hi,

    If the radio button is the fieldname1 field, and its choices have the values: 1, 2, and 3, respectively, the equation associated to the calculated field would be as simple as:

    IF( OR( fieldname1==1, fieldname1==3), 3.5, 2.5 )

    In the radio buttons you can select only one choice, so, should be used the “OR” operator and not the “AND”.

    The previous equation returns the value 3.5 if the is selected the first or third choice of the field, and 2.5 in other cases.

    Best regards.

    Thread Starter Electroguy

    (@electroguy)

    I have 4 radio buttons.. Button 1 and 3 needs to have the value 3.5, button 4: 3.2 , and button 2: 0.6. So I tried to add another statement to it, such as: “IF (fieldname8==2), 0.6”, but it doesn’t work…
    How can I fix that?!

    Plugin Author codepeople

    (@codepeople)

    Hi,

    In this case you can use the following equation:

    (function(){
    var f = fieldname8;
    if( f==1 || f==3) return 3.5;
    if( f==2 ) return 0.6;
    return 3.2;
    })()

    If the value of fieldname8 field is 1 or 3, the equation returns 3.5, if the value of the field is 2, the result would be 0.6, and 3.2 in other cases.

    Best regards.

    Thread Starter Electroguy

    (@electroguy)

    It works!!! Thank you SOOO much!!!

    Thread Starter Electroguy

    (@electroguy)

    I need to calculated this:

    (value_A / (1 – ((1 + value_A) ^ -value_B))) * value_C
    In excel it’s easy to calculated, but in your plugin it’s something different.
    I have read something about the POW() function, but I tried everything and it didn’t work..

    Can you tell me how I need to calculated this?!

    Kind Regards,

    Electroguy

    Plugin Author codepeople

    (@codepeople)

    Hi,

    I’ll assume that:

    Value_A is the fieldname1,
    Value_B is the fieldname2,
    and Value_C is the fieldname3.

    you should use the corresponding fields names in your form.

    So, the equation would be:

    (fieldname1 / (1 - 1*POW(1 + fieldname1, -1*fieldname2))) * fieldname3

    Best regards.

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

The topic ‘Good Plugin’ is closed to new replies.