amrali / parsleyjs-meteor

Meteor packaging for Parsley.js
10 stars 14 forks source link

radio buttons wrapping #22

Open phxigloo opened 9 years ago

phxigloo commented 9 years ago

Probably a parsleyjs thing, but in bootstrap 4 "toggle button bar" styled radio buttons will stack the radio buttons vertically i.e. You want (to appear as buttons):

radio1 radio2 radio 3

becomes

radio 1 radio2 radio 3

The code:

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-success-outline active">
     <input type="radio" name="scheduleType" id="scheduleType1" autocomplete="off">Flexible
 </label> 
 <label class="btn btn-success-outline checkbox-inline">
    <input type="radio" name="scheduleType" id="scheduleType2" autocomplete="off">Fixed
  </label>
</div>

Looking at the html, it appears parsley inserts a

<ul id='parsley-id-multiple-RADIONAME'> 

after the first radio, which breaks the layout.

The workaround, unless there is a way to skip validation on a control, is to put

Template.THEAFFECTEDTEMPLATE.onRendered(function (){
$('#parsley-id-multiple-scheduleType').remove();
});

Seems to work, but haven't fully tested it

isAlmogK commented 9 years ago

It might the parsley version, try my package. almogdesign:parsleyjs it's updated to the correct version