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

    (@codepeople)

    Hello @greaterwash,

    Summarizing, you want populate fields in the form with the values of URL’s parameters. I’ll try to describe the process with an example.

    Assuming that the URL parameters are:

    param_a, param_b and param_c

    and you want populate the form’s fields: fieldname1, fieldname2 and fieldname3 with the previous parameters respectively:

    You simply should insert three shortcode to generate the javascript variables from the URL’s parameters, and a piece of javascript code to define the default values of fields in the content of the webpage (it is the same webpage where is inserted the form) as follows:

    
    [CP_CALCULATED_FIELDS_VAR name="param_a" default_value=""]
    [CP_CALCULATED_FIELDS_VAR name="param_b" default_value=""]
    [CP_CALCULATED_FIELDS_VAR name="param_c" default_value=""]
    <script>
    cpcff_default = { 1 : {} };
    cpcff_default[1][ 'fieldname1' ] = param_a ;
    cpcff_default[1][ 'fieldname2' ] = param_b;
    cpcff_default[1][ 'fieldname3' ] = param_c;
    </script>
    

    More information in the following links:
    https://cff.dwbooster.com/documentation#javascript-variables
    https://cff.dwbooster.com/documentation#populate-form

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding invisible fields’ is closed to new replies.