I need to remove a field in my editor form if a specific value is input

I need to remove a field in my editor form if a specific value is input

llampreallamprea Posts: 10Questions: 6Answers: 0

One of my fields is a drop down menu, and if a specific value is chosen for that, i need to be able to remove the option to edit another field

$( 'input', editor.get('license_type') ).on( 'change', function () {

    console.log('hi');

    if ( editor.get( 'license_type' ) === 'Evaluation - Mobile Device Push') {
        console.log('hi');
        editor.hide( 'expiration_date' );
        editor.set('expiration_date', expireTime);
    }
    else {
        editor.show( 'expiration_date' );
    }
} );

I've tried this but it does nothing

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited November 2014

    That looks almost correct to me, but I suspect you want to use a select element, rather than an input (based on your comment about it being a drop down) do you not? Just the jQuery selector needs to be changed if so.

    Allan

This discussion has been closed.