Is there a leave field event or field on blur?

Is there a leave field event or field on blur?

llampreallamprea Posts: 10Questions: 6Answers: 0
edited December 2014 in Editor

Right now my code looks like this:

$( 'input', editor.field('account_name').node() ).on(
'click', function () {

But instead of a click i'd like the event to be when i finish editing the field above "account name".

Is there a way to accomplish this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,759Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Is it the blur event you are looking for?

    $( 'input', editor.field('account_name').node() ).on( 'blur', function () {
      ...
    } );
    

    Or something else? The only problem with blur is that the user might not leave it to edit another field before submitting the form (they might just hit enter for example) - but that is the trouble with knowing when the input has finished!

    Allan

  • llampreallamprea Posts: 10Questions: 6Answers: 0

    Perfect, thanks for your quick answers!

This discussion has been closed.