How would I go about using the following script only when the widget is used?
<?php
//sidedish slide script
function sidedish_slide_script() {
wp_register_script('add-sd-js', get_template_directory_uri() . '/form-slider/jquery-1.8.2.min.js', array('jquery'),'null', true );
wp_register_script('add-sd-custom', get_template_directory_uri() . '/form-slider/formslider.js', array('jquery'),'null', true );
wp_register_style('add-sd-css',get_stylesheet_directory_uri() . '/form-slider/styles.css', '','','screen' );
wp_enqueue_script ('add-sd-js');
wp_enqueue_script ('add-sd-custom');
wp_enqueue_style ('add-sd-css');
}
add_action('wp_enqueue_scripts','sidedish_slide_script');
?>