0

We use bundle item. Customer can make a combination of different sku's. We group the sku' in logical sections (e.g. motor, color, wheels, ...). Some groups are required to have at least one entry others not (e.g. accessory).

Initially all groups are toggled hidden for easier orientation. After clicking "Add to cart" we show all groups with jQuery('dd').show() to enable the magento validation of the checkbox groups (required or not).

Question: We just want to show all groups (element <dd>) if the above label of <dt> has the class "required" or if easier use the class="validate-one-required-by-name" from the child input box within the <li> element. So the customer has the focus only on the required bundle groups he has to mark es checked.

HTML Structure is:

<dl>
 <dt>
  <label class="required">
 </dt>
 <dd>  <--- this i want to show if <label> class of above <dt> is "required".
  <div>
   <ul>
   <li><span><input class="...validate-one-required-by-name"></input></span></li>
   <li><span><input class="...validate-one-required-by-name"></input></span></li>
   <li><span><input class="...validate-one-required-by-name"></input></span></li>
  </div>
 </dd>
<dl>

enter image description here

How can I make the show of <dd> element dependent from the above <dt> <label> class "required" or from the child class of the <input-box> in the <li> list?

Finally found the answer:

jQuery('input').filter('.validate-one-required-by-name').closest('dd').show();
0

1 Answer 1

1

Answer as found by OP.

Using jQuery('input').filter('.validate-one-required-by-name').closest('dd').show();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.