I need to format a custom field in admin area (post edit) as a currency, eq: 12.000,00 , with user typing only the numbers, the , and . automatic. Ive searched arround, with no sucess.. Anyone? thank
The code i am trying to use to enqueue script in admin is
function enqueue_admin() {
wp_enqueue_script( 'jquery' ); //adding Jquery to admin. Not sure if is needed or already there
wp_register_script( 'autonum', THEME_DIR . '/js/vendor/autoNumeric.js', array( 'jquery' ), '1', false ); //this is autoNumeric for currency format
wp_enqueue_script( 'autonum' );
}
add_action( 'admin_enqueue_scripts', 'enqueue_admin' );
Also, not sure if i need to change all the $ to JQuery in autoNumeric.js, because of wordpress compatibility