View Single Post
  #9  
Old 04-05-2013, 07:14 AM
A Wee ClicK's Avatar
A Wee ClicK A Wee ClicK is offline
Webpartner
 
Join Date: Aug 2011
Location: UK (Northern Ireland)
Posts: 89
Default

Matvey,

Another quick question:

I want to reset all of the sub options to Not Required if somebody clicks on one of the embroidery options and then changes their mind and clicks on "Not Required":

Normally you use this (I think) to set a radio button:

Quote:
jQuery('input[class="sort"]').attr('checked',true);

In your example code you used this to see which radio button had been selected

Quote:
jQuery("div[class *= ecwid-productoption-" + expanderOptionName + "] input:checked + label > span").text()

This is my interpretation of what it should look like (chances are it is wrong as I am not a jquery programmer)

Quote:
jQuery('input[class *= "ecwid-productoption-" + expanderOptionName + "] + label > span"').attr('checked',true);
If it is not correct what should it be?


SOLVED

Passed page.productId to the function checkExpandableOptions


Then retrieved the ids of the set of radio buttons as an array - document.getElementsByName( productId + "-name of radio button set");

Quote:
var radios1 = document.getElementsByName( productId + "-name of radio button set");

Then set the Not Required button as checked:

Quote:
jQuery("#" + radios1[2].id)[0].checked = true;
__________________
Andrew

---------------------------------------------
UtterApparel.com
ASLCreative.com
Zingaboo.com

Last edited by A Wee ClicK; 04-06-2013 at 07:34 AM. Reason: SOLVED
The Following User Says Thank You to A Wee ClicK For This Useful Post:
Matt Ecwid (04-08-2013)