Hi Caridad, did you check out the link I gave you?
Your collegue provided a javascript to do exactly what I want to do, add a 'star' class to the input element.
However, I therefore need her javascript, and I agree this should be made a lot easier.
Please see my topic here: https://toolset.com/forums/topic/layout-cred-forms/
In cred you now have to choose between two styles, minimal and styled. There is no way that it is easy to manage with twitter bootstrap features, something I hoped because there is also a toolset bootstrap theme released. This already includes all CSS for forms, so the 'minimal' and 'styled' css are not needed if people work with the toolset bootstrap theme. So if we can be free in editing elements the shortcodes output, that would be really good for integration with twitter bootstrap, and, in this case also with a third party javascript that needs the class "star" on the input element.
So, that being said, can you help me with getting the javascript to work? For some reason I can't manage to 'activate' it because obviously the "star" class I added does not do anything. I already had a JS folder in my childtheme with a .js file with some custom JS for twitter bootstrap. However, this javascript file I can't enable, I tried 4 thing, see below:
function add_my_scripts() {
wp_register_script('stars', get_stylesheet_directory_uri() . '/js/jquery.rating.pack.js');
wp_enqueue_script('stars');
}
add_action('wp_enqueue_scripts', 'add_my_scripts'); // We are using the wp_enqueue_scripts function, and giving our function an arbitrary name of add_my_scripts
/* Stars jquery */
function my_toolset_bootstrap_childtheme_stars_jquery() {
wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/jquery.rating.pack.js');
}
add_action('wp_enqueue_scripts', 'my_toolset_bootstrap_childtheme_stars_jquery');
function my_toolset_bootstrap_childtheme_scripts_method() {
wp_enqueue_script(
'custom_script',
get_stylesheet_directory_uri() . '/js/toolset-bootstrap-child.js',
array('jquery')
);
wp_enqueue_script(
'custom_script',
get_stylesheet_directory_uri() . '/js/jquery.rating.pack.js',
array('jquery')
);
}
add_action('wp_enqueue_scripts', 'my_toolset_bootstrap_childtheme_scripts_method');
function my_toolset_bootstrap_childtheme_scripts_method() {
wp_enqueue_script(
'custom_script',
get_stylesheet_directory_uri() . '/js/toolset-bootstrap-child.js',
array('jquery')
);
wp_enqueue_script(
'custom_script',
get_stylesheet_directory_uri() . '/js/jquery.rating.pack.js',
array('jquery')
);
}
add_action('wp_enqueue_scripts', 'my_toolset_bootstrap_childtheme_scripts_method');
What am I doing wrong?
Kind regards,
Willem