Show and Hide Text Box Based on Selected Picklist Value using Jquery

<html>  
<head>  
  
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>     
<script type="text/javascript">     
$(document).ready(function() {     
$('#types').change(function(){     
if($('#types').val() === 'Other')     
   {     
   $('#other').show();      
   }     
else    
   {     
   $('#other').hide();        
   }     
});     
});     
</script>     
</head>     
  
<body>     
    
<select id="types" name="types" >     
 <option value="Type 1">Type 1</option>     
 <option value="Type 2">Type 2</option>     
 <option value="Type 3">Type 3</option>     
 <option value="Other">Other</option>     
</select>     
    
<input type="text" id="other" name="other" style="display: none;"/> 
</body>  
  
</html>  

Comments

Popular posts from this blog

Salesforce Spring 16 Release Exam (Maintenance Exam Q&A) for Developer 201 Admin

Show Hyper Link On Add Error in Salesforce Trigger

Show the Success Message before Redirecting the Detail page on Visualforce Page