Dynamically update value of newly added group row
-
I’m trying to add a field value to an input in a group field – each time a new group row is added.
This is what I’ve got so far; it does update the value, but the value is not displayed to the user. Any ideas why?
Thanks!
$('.cppg').find('.cmb-repeatable-group').on( 'cmb2_add_row', function( evt, row ) { var iteratorValue = row.data('iterator'); var $idField = $(row).find('input:not([type="button"]), textarea, select').first(); $idField.val(iteratorValue); $idField.css('background-color', 'red'); // this works fine console.log( $idField.val() ); // this works fine });
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Dynamically update value of newly added group row’ is closed to new replies.