editor.field() Multiple

editor.field() Multiple

aungkoheinaungkohein Posts: 16Questions: 4Answers: 0

How do I handle multiple fields?

Field Names: status, comments

Only when status change, it's working. There is no change when comments field is edited.

$( editor.field( 'status, 'comments' ).input() ).on( 'keyup', function (e, d) {
if ( ! d || ! d.editor ) {
  //Assign updated_by user
  editor.field( 'updated_by' ).val( username);
}
} );

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 48,482Questions: 1Answers: 7,023 Site admin
    Answer ✓

    As the field() documentation notes, it only accepts a single parameter. The second parameter in your code above is ignored, which matches the behaviour you are seeing.

    You'd need to use field() twice. Once for each field.

    Allan

Sign In or Register to comment.