jQuery('input#distance').attr('value', jQuery('#dist-dropdown').val()); jQuery('#dist-dropdown').change(function() { var distance = jQuery('#dist-dropdown option:selected').val(); jQuery('input#distance').attr('value', distance); });
<input type="text" id="distance" name="distance" /> <div id="dist-dd"> <select name="dist-dropdown" id="dist-dropdown"> <option value="10">10 Miles</option> <option value="25">25 Miles</option> <option value="50">50 Miles</option> <option value="75">75 Miles</option> <option value="100">100 Miles</option> <option value="200">200 Miles</option> <option value="300">300 Miles</option> <option value="500">500 Miles</option> <option value="99999">Any Distance</option> </select> </div>
There are currently 1 users browsing this thread. (0 members and 1 guests)