Reputation: 239
I am trying to add a bit of functionality to a jQuery UI calendar but am fairly new to jQuery and am having a bit of problem with my code. This is what I have at the moment:
<input name="button" type="radio" value="3days"/><label>Add 3 Days</label>
<p><input name="button" type="radio" value="0days"/></p>
<p>Date: <input type="text" id="datepicker" /></p>
Jquery:
$(function(){
$('input[value="3days"]').click(function(){
if ($(this).is(':checked'))
{
$('#datepicker').datepicker({ minDate: +3 });
}
else
{
$('#datepicker').datepicker({ minDate: 0 });
}
});
});
I basically want to block the first 3 days if a radio button is selected. If its not selected then I would like only the current date onward to be selectable.
If anyone could suggest some alterations to my code that would be great.
Upvotes: 0
Views: 187