here I would like to make a comparison between current date to date where inputted.
<script type="text/javascript">
$(document).ready(function(){
$("#date").change(function(){
var realDate = new Date();
var startDate = new Date($('#date').val());
if (realDate >= startDate) {
$('#infobros').removeClass('hidden');
}else{
$('#infobros').addClass('hidden');
}
});
});
function validateForm(){
var realDate = new Date();
var startDate = new Date($('#date').val());
if (realDate >= startDate){
alert('Please Change your date Start');
$('#date').focus();
return false;
}
}
</script>
in there i want to make my id #infobors
remove class hidden
when i input startDate
its to low more than my realDate
or if startDate
same or more than realDate
.
but, now if I input the same date to the current date #infobros still performing.
btw: my format startDate = YYYY-MM-DD
but i dont know the format of my realDate
I hope someone can help me, and make my script is work..
btw : this my format realDate :
can someone help me change to : YYYY-MM-DD