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

    (@codepeople)

    Hello @jadmac12

    You should insert a currency field to enter the typical pay per month, a checkbox to tick when the user does not know how much he pays, and a button with the “Calculate” option as its type.

    Additionally, you should insert a DIV field to display the results, and enter the hide class name through its “Add CSS Layout Keywords” attribute.

    To display the DIV field for results by pressing the calculate button, please, enter the following piece of code as the button on-click event:

    SHOWFIELD('fieldname123');

    I assumed the DIV field’s name is fieldname123, but you should use the name of the field in your form.

    Now, the texts, charts, and any other fields for results must be inserted into the DIV field to show or hide them at once.

    To generate the bar chart, you can use the CFFCHART operation. Please, read the following post on the plugin’s blog:

    https://cff.dwbooster.com/blog/2019/05/27/charts

    To display the mathematical result in a block of text instead of the calculated field, you must:

    – Insert an “HTML Content” field with the text block including the tag that displays the equation result as its content:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
    sed do eiusmod <span class="result-here"></span> tempor incididunt ut labore et dolore magna aliqua.

    – Edit the equation to display the result in the previous span tag. For example, if your current equation is fieldname1+fieldname2, you can edit it as follows:

    (function(){
    var result = fieldname1+fieldname2;
    jQuery('.result-here').html(result);
    return result;
    })()

    – Finally, since the calculated field is being used as an auxiliary, you can hide it by ticking a checkbox in it.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I make a form like this…’ is closed to new replies.