0

I have 4 Radio buttons but depending on your selection of a dropdown will affect what to show. My question is how can I make them show in the same place. E.g when the first two show up it looks great, but when the second two show up they show with a space as if the first two are still there only invisible. So I want no matter what two show, they will be in the same position.

Here is some of the code I'm using.

HTML:

<div id="rdtrue" style="float: left; padding-left:10px; text-align:left; vertical-align:text-top;">

  <input type="radio" class="classRt classLR" name="requestType" id="rdNew" value="New">
  <label for="rdNew" class="classRt classLR">New</label><br>

  <input type="radio" class="classRt classLR" name="requestType" id="rdSecond" value="Existing">
  <label for="rdSecond" class="classRt classLR">Second</label><br>

  <input type="radio" class="classRt classInv" name="requestType" id="tdVW" value="Paper">
  <label for="rdVW" class="classRt classInv">VW</label><br>

  <input type="radio" class="classRt classInv" name="requestType" id="rdFord" value="Plastic">
  <label for="rdFord" class="classRt classInv">Ford</label><br>

</div>

<select id="ddlRequestType" onchange="GetChoice(this.value);">
  <option value="MISSING" selected>Select</option>
  <option value="Inventory">Inventory</option>
  <option value="Letter">Letter</option>
  <option value="Report">Report</option>
</select>

Javascript:

function hideClass(val) {
  var cls = document.getElementsByClassName(val);
  var i;
  for (i = 0; i < cls.length; i++) {
    cls[i].style.display = 'none';
  }
}

function showClass(val) {
  var cls = document.getElementsByClassName(val);
  var i;
  for (i = 0; i < cls.length; i++) {
    cls[i].style.display = 'inline';
  }
}
Niall29
  • 1
  • 2
  • 3
    We'll be needing your current HTML to see what we can do. – roberrrt-s Oct 05 '17 at 13:08
  • How are you hiding them? Try `display: none` instead of `visibility: hidden`. This will help: https://stackoverflow.com/questions/133051/what-is-the-difference-between-visibilityhidden-and-displaynone – Rajesh Oct 05 '17 at 13:12

0 Answers0