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

    (@codepeople)

    Hi,

    Yes of course, in the equations you can use any javascript code.

    For example, suppose your page includes a DIV tag with the class name: “mytag” assigned to it. The DIV tag can be inserted directly in the webpage, or into a “HTML Content” field in the form, and then, from any of the equations associated to a calculated field, you can insert the value into the tag as follows:

    (function(){
    jQuery( '.myfield' ).html( 'The value Here' );
    })()

    Best regards.

    Thread Starter bsusala

    (@bsusala)

    Works, yey. Thanks for your fast answer! So, basically I can use a hidden calculation field with many js functions as a sort of global JS processor? This is my first attempt at JS, so thanks again for allowing me to force-learn (the best learning :))

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Not really, you should associate to the calculated field only one function, but assing the values to all tags from the same equation.

    For example, to assign the values to two DIV tags with the class names: “my-first-tag”, and “my-second-tag” respectively:

    (function(){
    jQuery( '.my-first-tag' ).html( 'The value for the first tag Here' );
    jQuery( '.my-second-tag' ).html( 'The value for the second tag Here' );
    })()

    Best regards.

    Thread Starter bsusala

    (@bsusala)

    Ok, thanks very much, so let’s format the table, then ?? For reference, I try to use this method for nicely formatting tabular data, in the form of an invoice output. Although I have to write functions, I style more easily like that.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    If you want to create a form with a tabular format, you can use special classes names: column2, column3, or column4 in your form’s fields, or the “columns” attribute in the container fields (DIV, and Fieldset fields), more information in the following link:

    https://cff.dwbooster.com/faq#q66

    Best regards.

    Thread Starter bsusala

    (@bsusala)

    I know, I know. I was actually in the middle of the table with columns method when you answered, BUT I think the JS way is allowing me to keep the logic apart from the design. And I learn JS, too, BONUS! Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Inserting calculated results/values in HTML’ is closed to new replies.