Posted by sridharpandu on February 2, 2013 at 5:02pm
I created a webform with elements to pick month, date and year and included a popup calendar. I then noticed that user is unable to chose a date lesser than today (desired behaviour) from the popup calendar but there is no way to stop someone from chosing a date lesser than today from the select list. To overcome this I have had to write some large chunks of javaScript to throw ALERT messages.
Anyone know of a way to stop users from chosing a date lesser than today from the SELECT list.
Comments
Best Using Jquery.
u can restrict the user by jquery .
For example
jQuery("#ur-calender-id").datepicker( "option", "onSelect",
function(datealert) {
var date = jQuery('#field-id').datepicker('getDate');
if(your condition){alert(blah blah);}
});
Try this. Sure it will work.
Suresh.E
--Life Knocks us down. we have to decide whether or not to get up--
I would like to prevent
I would like too prevent users from chosing already elapsed dates. Alert messages are already in place.
Acer Aspire 5745
[i5 430M, 3GB, 320GB]
Ubuntu 12.04 (Precise Pangolin)
Drupal 6.15, 7.x
Aware Hosting, Go Daddy, LimeDomains, Rackspace, Tata Instacompute
could u please
could please explain briefly?
Suresh.E
--Life Knocks us down. we have to decide whether or not to get up--
shouldn't chose a date...
Users shouldn't chhose a date or time that has been elapsed. i.e. all dates and times before the current date and time should be disabled.
Acer Aspire 5745
[i5 430M, 3GB, 320GB]
Ubuntu 12.04 (Precise Pangolin)
Drupal 6.15, 7.x
Aware Hosting, Go Daddy, LimeDomains, Rackspace, Tata Instacompute