jQuery and Ninja Forms WordPress Plugin

I want to change the value of a Ninja Form input with jQuery, eg:

$('#ninja_forms_field_6').val(somevalue);

But this just wont work, probably because values and calculations are done in the back by PHP.

Read More

A + B gives me the Total

What I want is ether to have jQuery “auto type” text into field or to extract given value of the total input.

I said “auto type” because A and B values are being calculated only when I manually type them on keyboard. When I used $('#ninja_forms_field_6').val(somevalue) – the value shows up as if it is typed but calculation does not happen.
The other solution for me is to get the calculated value/text that shows up in the Total input after calculation, but as you can see in the image the input tag stays empty.

<input id="ninja_forms_field_8" name="ninja_forms_field_8" value="0" disabled="" class="ninja-forms-field " rel="8" type="text"></input>

Input for the total stays empty whether its showing the result or not.

If you can help me with this, you would have my eternal gratitude.

Related posts

Leave a Reply

2 comments

  1. Try to trigger a “change” event after changing the value of the field:

    $('#ninja_forms_field_6').trigger("change");
    

    That worked for me in some select fields, I don’t know if it will work on other types of fields. Maybe trying some other jquery event type will work if “change” does not.