Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="dbType" id="dbType">
- <option>Choose Database Type</option>
- <option value="oracle">Oracle</option>
- <option value="mssql">MS SQL</option>
- <option value="mysql">MySQL</option>
- <option value="other">Other</option>
- </select>
- <div id="otherType" style="display:none;">
- <label for="specify">Specify</label>
- <input type="text" name="specify" placeholder="Specify Databse Type"/>
- </div>
- //Original discussion and solution here: http://stackoverflow.com/questions/15566999/how-to-show-form-input-fields-based-on-select-value | http://jsfiddle.net/ks6cv/
- $('#dbType').on('change',function(){
- var selection = $(this).val();
- switch(selection){
- case "other":
- $("#otherType").show()
- break;
- default:
- $("#otherType").hide()
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment