I try to implement this jQuery script http://rikrikrik.com/jquery/magicpreview/ in order to allow a dynamic preview of my form. The script works on a static html site but not with my local wordpress/gf installation.
I placed the script in my header file:
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.magicpreview.js"></script>
and I placed the gform render hook underneath it as well:
<script type="text/javascript">
jQuery(document).bind('gform_post_render', function(){
// code to trigger on AJAX form render
$(function () {
// Example 1
$('form.example input:text').magicpreview('mp_');
// Example 2
$('form.photopreview :text').magicpreview('mp_');
$('form.photopreview :checkbox').magicpreview('mp_');
$('form.photopreview textarea').magicpreview('mp_');
$('form.photopreview select').magicpreview('mp_');
$('form.photopreview :radio').magicpreview('mp_', {
'formatValue': function (value) {
return value;
}
});
});
});
</script>
On my form I used a simple multiple choice field (name tags input_1, input_2, ...) and a html block in which I put the corresponding div tags for the magical preview script (<div id="mp_input_1"><div id="mp_input_2" ...).
When I click on one of the choices its value should be displayed in the div tag. but well...actually nothing happens. thanks for following me so far. any helf would be much appreciated.
EDIT: PS. I'm sorry but by the time being I can't provide a link to live site. it's all on my local test environment.