Help with .change (show a field on a <select> change)
First off, any help would be greatly appreciated. I'm sure some experts around here wouldn't have a problem at all! Below is the relative code:
- <select id="cash_or_check">
- <option value="cash" SELECTED>Cash</option>
- <option value="check">Check</option>
- </select>
- <input type="text" id="check_number" name="check_number" size="10" />
- $(document).ready(function(){
- $('#check_number').hide();
- });
- $('#cash_or_check').change(function() {
- $('#check_number').show();
- });
All I am attempting to do is when the value is changed from "cash" to "check" the text field "check_number" appears. As of right now I have it hidden via the first three lines of the JavaScript file, but the field doesn't appear when "cash_or_check" is selected.
Thanks!