0
 <div class="control-group">
 <label class="span4">Required Date <span class="red">*</span></label>
  <div class="input-append date datepick span7 required" name="datetimepicker" id="datetimepicker">
    <span class="add-on"><i class="icon-th icon-calendar"></i></span>
  <input class="span12 form-control required" name="date" id="date"  type="text" placeholder="dd/mm/yyyy" data-format="dd/MM/yyyy" readonly>
</div>

$('#date').change(function(){
  var date = $(this).val();
  alert(date);
});

I dont know what the problem but is but this change event is not working. Maybe the readonly property of input is messing with something. Please help guys.

Nick
  • 63
  • 11

1 Answers1

0

Updated:

$(document).ready(function() {
    function changeDate(newdate) {
        var date = newdate;
        alert(date);
    }

    $('input#date').change(function() {
        changeDate($(this).val());
    });

    changeDate($('input#date').val());
});

This ought to work.

AkiEru
  • 780
  • 1
  • 9
  • 34