• Resolved zawisha

    (@zawisha)


    Basically I am not able to get value of any field via vanilla JavaScript from fields generated by CFF form. Using getElementById always returns null. I don’t have this issue with other objects. How to properly refer to the calculated field results in CFF via js ?

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

    (@codepeople)

    Hello @zawisha

    The simplest alternative would be to use own plugin operations, like:

    getField('fieldname1').val();

    Best regards.

    Thread Starter zawisha

    (@zawisha)

    It may work, however, it does not solve the core issue. I need to refer somehow to the object via js. I don’t think plugin operations will help with that. Even if I get the value I cannot format or modify the object dynamically outside js.

    Plugin Author codepeople

    (@codepeople)

    Hello @zawisha

    If you need a reference to the field’s input tag, you can use pieces of code like:

    getField('fieldname1').jQueryRef().find('input');

    or

    jQuery('[id*="fieldname1_"]')

    If you want to assign a new value to the field via plugin operations:

    getField('fieldname1').setVal(222);

    Best regards.

    Thread Starter zawisha

    (@zawisha)

    I see. Great. With few changes it’s working as intended.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use Javascript to get calculated field value’ is closed to new replies.