Search and Top Navigation
#3047 closed bug (fixed)
Opened June 29, 2008 07:11PM UTC
Closed July 04, 2008 05:52PM UTC
Last modified July 04, 2008 05:52PM UTC
DatePicker in UI 1.5.1 does not cancel button click
Reported by: | anup | Owned by: | kbwood |
---|---|---|---|
Priority: | critical | Milestone: | 1.5.2 |
Component: | ui.core | Version: | 1.5.1 |
Keywords: | datepicker, button | Cc: | |
Blocked by: | Blocking: |
Description
In the latest jquery UI, 1.5.1, I use a date picker using the following options:
{ dateFormat: 'yy-mm-dd', showOn: 'button', buttonText: '…' };
This renders a button correctly next to the input box.
However, clicking the button causes the page to submit.
If I return false in the trigger, then this problem goes away.
For example, the current code is this in the DatePicker :
(Line 345)
trigger.click(function() {
if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
$.datepicker._hideDatepicker();
else
$.datepicker._showDatepicker(target);
});
If I simply add return false after the if/else, then it works.