• Resolved sagarchataut

    (@sagarchataut)


    The function to use Another field in the form as a predefined value is not working for field-type “Number”.

    I have made a form A, where a fieldname1 has to be entered manually in a fieldtype Number, and I copied it to create form-B. In form B, I want to calculate the data in a new fieldname2 and then transfer the result to the fieldtype Number in fieldname1 of Form B.
    Or is there any way to retain the fieldname just by changing the fieldtype?

    • This topic was modified 3 years, 4 months ago by sagarchataut.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @sagarchataut

    For filling a field in form B with the value of a field in form A (both forms on the same page), you will need some additional code.

    1. Assign a unique class name to the field in form A, for example, field-a

    The class names are assigned to the fields through their attributes “Add CSS Layout Keywords”.

    2. Assign unique class name to the field in form B, for example, field-b

    3. Finally, in form B, insert an “HTML Content” field with the following piece of code as its content:

    <script>
    jQuery(document).on('change', '.field-a input', function(){
    jQuery('.field-b input').val(this.value).change();
    });
    jQuery('.field-a input').change();
    </script>

    Best regards.

    Thread Starter sagarchataut

    (@sagarchataut)

    No, you didn’t understand me, I don’t want value from a form A, I only cloned it to make form B.

    What I want is the value from fieldname2 of form B to place that value in a fieldname1 of the same form B, which has a field type “Number”. The option to predefine a value in a placeholder with the help of another fieldname is not working.

    Or any way to change fieldtype of a form from “Number” to a “Calculated field type”, without changing its fieldname. As I have assigned the fieldname1 to various further calculations in the form B.

    Plugin Author codepeople

    (@codepeople)

    Hello @sagarchataut

    Please, send me the link to the page with the form to check its structure in detail.

    Best regards.

    Thread Starter sagarchataut

    (@sagarchataut)

    https://sagarchataut.com.np/design-of-continuous-beam/

    I have calculated the Overall Depth, which I want to transfer in the second overall depth (D)*, which is showing 0 only.

    Plugin Author codepeople

    (@codepeople)

    Hello @sagarchataut

    There are no problems with your form. When the fields are generated, the equations are not calculated yet. So, the value of the fieldname114 field is zero, and it will be the default value of the fieldname6 field.

    If you want assign the value of fieldname6 from the equation of the fieldname114 field, it should be edited as follows:

    (function(){
    var result = fieldname1+fieldname5;
    getField(6).setVal(result);
    return result;
    })()

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Another field in the form as predefined value is not working’ is closed to new replies.