setting input value problem
i have two text inputs
- Arrival <br><input id='datepicker1' type='text' value='04/24/2011' name='start_date'><br><br>
- Departure: <br><input id='datepicker2' type='text' value='04/24/2011' name='end_date'>
I'm trying to set the value of #datepicker2 to #datepicker1's value on blur. This is the code i have but does absolutely nothing.
- <script>
$("#datepicker1").bind('blur', function (){
var date = $("#datepicker1").val();
$("#datepicker2").val(date);
});
</script>
any help would be greatly appreciated!