last day (15 days later) » 

6:52 PM
0
A: Wordpress edit custom jquery don't works

SumitSeems to be your are loading jQuery two times. Remove the previous jQuery using wp_dequeue_script( 'jquery' );

 
I try it too, but it doesn't works
 
do you have any error in console on click ?
Why you are using live when you can do this with on with current version of wordpress jquery ?
 
I have multiple errors, but i don't know if it affects it. Here copy/paste justpaste.it/kn6f
 
I would suggest you use the wordpress default jQuery and change your function.
 
Can you show me how? Thanks
Hi sumit, how can i do this? I'm newbie in jquery
 
6:53 PM
try this
        jQuery(document).ready(function(){
            jQuery(document).on('change', '#title' function(event) {
                value = jQuery('#title').val().toUpperCase();
                jQuery('#title').val(value);
            });
        });
place the var before value
var value = jQuery('#title').val().toUpperCase();
 
ok
and on plugin php file only this
without regsiter jquery isn't it?
 
yes
exactly
remove your jquery please and check
 
now, collapse button works fine, but uppercase function no
this js file
and this php function
function gestion_edit_enqueue_scripts( $hook ) {

if( !in_array( $hook, array( 'post.php', 'post-new.php' ) ) )
return;
wp_enqueue_script(
'gestion_edit', // Handle
plugins_url( '/js/gestion_edit.js', __FILE__ ), // Path to file
array( 'JQuery' ) // Dependancies
);
}
add_action( 'admin_enqueue_scripts', 'gestion_edit_enqueue_scripts', 2000 );
 
in dependencies make it in lower case array( 'Jquery' )
and js file ?
 
7:00 PM
my typo
array( 'jquery' )
 
wp_enqueue_script('gestion_edit', plugins_url( '/js/gestion_edit.js', FILE ),array( 'jquery' ));
but it doesn't works :(
i try this
wp_enqueue_script('gestion_edit', plugin_dir_url( __FILE__ ).'js/gestion_edit.js',array( 'jquery' ));
but neither works
 
ok let me check once again
 
ok thank you so much
i'm come back no
 
ok my bad
there was a typo
jQuery(document).on('change', '#title', function(event) {
var value = jQuery('#title').val().toUpperCase();
jQuery('#title').val(value);
});
try this
i just forgot a comma :P
once you type in text box then click somewhere else value will be changed to uppercase in that text box
you threre ?
 
7:29 PM
i try now
perfect!!!!!!
it works fine!
 
cool
I am pasting this as answer
 
thank you so much Sumit!!!
 
please accept it
 
ok, i accept it now :)
 
great I made the changes
:)
wc :)
 
7:34 PM
done ;)
thanks Sumit!!
 
well done Javier :) happy coding ;)
 

last day (15 days later) »