javascript - option in form field hides option in next field -


i trying "10.30am" option dissapear in workshop time field when "monday 13th april" selected in workshop date field. failing happy if option disabled.

<div class="form-group"> <form action="ksmail.php" method="post">     <div class="form-group">         <div class="row">             <p class="control-label blue">workshop date:</p>             <select name="date" class="finput" id="wdate">                 <option value="11th_apr">saturday 11th april</option>                 <option value="13th_apr" id="dt">monday 13th     april</option>                 <option value="18th_apr">saturday 18th april</option>             </select>         </div>     </div>     <div class="form-group">         <div class="row">             <p class="control-label blue">workshop time:</p>             <select name="time" class="finput" id="wtime">                 <option value="9am" id="tn">9am</option>                 <option value="10_30am" id="tt">10.30am</option>             </select>         </div>     </div>     <div class="row">         <input type="submit" value="send" class="btn btn-default">     </div> </div> </form> </div> 

javascript

$('#wtime') .show();   $('#wdate').bind('change', function (e) {    if( $('#wdate').val() == "#dt") {       $('#tt').hide();   }   

css

#wtime{display: none;} 

i have tried many variations of none of work. sorry, jquery newbie/moron. appreciated.

your condition seem wrong. try one, hope helped :

$('#wtime').show();    $('#wdate').on('change', function (e) {     if( $(this).val() == "13th_apr") {       $('#tt').hide();     }   else   {     $('#tt').show();   } }); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

gradle error "Cannot convert the provided notation to a File or URI" -