Adding AJAX to sidebar widget
-
Hey all,
More of a coding question than a WP question, but just wondering if someone happens to know the answer –
I have a sidebar widget that gives people 3 options, and if they click the top option (multiple testimonials to be listed) then I’d like for a box unerneith that to be visible, but if one of the other 2 options are secected I’d like for the box to disappear.
Here is the code –
<p> <label for="<?php echo $this->get_field_id('style_list'); ?>"> <input class="" id="<?php echo $this->get_field_id('style_list'); ?>" name="<?php echo $this->get_field_name('testimonials_style'); ?>" type="radio" value="style_list" <?php if($testimonials_style === 'style_list'){ echo 'checked="checked"'; } ?> /> <?php _e('List style (Multiple)'); ?> </label><br /> <label for="<?php echo $this->get_field_id('numposts'); ?>"> <?php _e('Display this many testimonials:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('numposts'); ?>" name="<?php echo $this->get_field_name('numposts'); ?>" type="text" value="<?php echo $numposts; ?>" /> </label><br /> <label for="<?php echo $this->get_field_id('style_sidebar'); ?>"> <input class="" id="<?php echo $this->get_field_id('style_sidebar'); ?>" name="<?php echo $this->get_field_name('testimonials_style'); ?>" type="radio" value="style_sidebar" <?php if($testimonials_style === 'style_sidebar'){ echo 'checked="checked"'; } ?> /> <?php _e('Sidebar style (Single)'); ?> </label><br /> <label for="<?php echo $this->get_field_id('style_box'); ?>"> <input class="" id="<?php echo $this->get_field_id('style_box'); ?>" name="<?php echo $this->get_field_name('testimonials_style'); ?>" type="radio" value="style_box" <?php if($testimonials_style === 'style_box'){ echo 'checked="checked"'; } ?> /> <?php _e('Box style (Single)'); ?> </label> </p>
I realise it’ not really WP but would be very appricative if anyone here happens to be a guru on this.
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding AJAX to sidebar widget’ is closed to new replies.