jquery - display button after user choose options in multiple dropdown -


i want display button after user chooses option in every dropdown list. thank's help.

button

 <button class="generate">generate iframe</button> 

dropdown lists

 <form id="video_selection">      <select id="select_video1" onchange="changevideo1()">          <option>vidéo 1</option>          <?php          foreach($id $video1)          {              $videoid1 = $video1['id'];              $videolink1 = $video1['link'];          ?>          <option id="video1_iframe" value="<?php echo $videolink1;?>"><?php echo $videolink1;?></option>          <?php          }          ?>      </select>      <select id="select_video2" onchange="changevideo2()">          <option>vidéo 2</option>          <?php          foreach($id2 $video2)          {              $videoid2 = $video2['id'];              $videolink2 = $video2['link'];          ?>          <option id="video2_iframe" value="<?php echo $videolink2;?>"><?php echo $videolink2;?></option>          <?php          }          ?>     </select> </form> 

your jquery code along lines of:

$('select').on('change', function() {    var unselected = $('select').filter(function() {      return this.selectedindex <= 0;    });    if (unselected.length) return;    $('.generate').show();  });
.generate {    display: none;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <select>    <option value="1">first</option>    <option value="2">second</option>    <option value="3">third</option>    <option value="4">fourth</option>  </select>  <select>    <option value="1">first</option>    <option value="2">second</option>    <option value="3">third</option>    <option value="4">fourth</option>  </select>  <select>    <option value="1">first</option>    <option value="2">second</option>    <option value="3">third</option>    <option value="4">fourth</option>  </select>  <button class="generate">generate iframe</button>


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -