Skip to content

Instantly share code, notes, and snippets.

@pranali333
Created March 16, 2017 13:15
Show Gist options
  • Save pranali333/f2e18b03464ed8fcdbba5f2e836f384d to your computer and use it in GitHub Desktop.
Save pranali333/f2e18b03464ed8fcdbba5f2e836f384d to your computer and use it in GitHub Desktop.
Custom JavaScript code to set the value in the custom hiddenfield under rtMedia uploader
jQuery( document ).ready( function () {
$custom_dropdown = jQuery( '#custom_dropdown_list' );
$custom_input = jQuery( "#custom_media_type" );
$custom_input.val( $custom_dropdown.val() );
$custom_dropdown.on( 'change', function() {
$custom_input.val( $custom_dropdown.val() );
} );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment