Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Formidable Form Experts Required (Copying Field Value Conditionally) WordPress

  • SOLVED

Copying Field value to another field conditionally. Plz see the attached image for details.

I tried this code
<script type="text/javascript">
jQuery(document).ready(function($){
$('#field_iu157').change(function(){
var val1 = $("#field_iu157").val();
var val2 = $("#field_bclze").val();
if (val2 < val1) {
$("#field_bclze").val(val1);
}
});
});
</script>

But the problem is if the user write something on other fields from which 1st field is calculated then this code does not work.

Answers (2)

2018-04-22

Reigel Gallarde answers:

you should call $('#field_iu157').trigger('change');

every time you change the value of $('#field_iu157') in your code...

example: $('#field_iu157').val(value).trigger('change'),

2018-04-24

Mohamed Ahmed answers:

For best answer, Could you tell me what is the URL of this form?