View Single Post
Old 03-15-2013, 09:23 AM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 89
Default Trying To Hide Some Product Options Based On If Radio Button Is Checked

I am trying to hide the radio buttons of certain options when the product page is first loaded and when a particular radio button is clicked, the other options appear.

The test page I have is at

I am a beginner in using jquery and not quite sure how to combine the productId value into the jquery statement.

The jquery code I have formulated is:

Ecwid.OnPageLoad.add(function(page) {
if (page.type == "PRODUCT") {

$('input:radio[name=productId+"-Do You Require An Embroidered Logo"]').click(function() {
var $this = $(this);
if ( $this.val() == "on" ) {
$this.nextAll("#ecwid-productoption-"+productId+"-If_you_require_a_logo_to_be_embroidered:002c_has_t his_already_been_set_up_by_us-container").show();
} else {
$this.nextAll("#ecwid-productoption-"+productId+"-If_you_require_a_logo_to_be_embroidered:002c_has_t his_already_been_set_up_by_us-container").hide();

I know I am nearly there with this - any help and guidance would be most appreciated.