Skip to main content

Search and Top Navigation

#8403 closed bug (notabug)

Opened June 19, 2012 01:18AM UTC

Closed July 10, 2012 08:29AM UTC

Last modified May 18, 2017 10:35AM UTC

Datepicker href Problem

Reported by: jeremy Owned by: jeremy
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.21
Keywords: Cc:
Blocked by: Blocking:
Description

If you click on a day TD in the latest version of the datepicker with Internet Explorer, Internet Explorer will cheerfully process the onclick attribute on the TD ... and then go on to process the default action of the A tag inside the TD, which is to navigate to the href ("#"). This might not be an issue for many sites, but for a Javascript-heavy "thick client" page, which relies on the anchor for navigation, it's a real problem.

This can be fixed simply by changing this line of the date picker's code (inside its _generateHTML method) from:

'" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date

to:

'">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date

or, if you want to preserve the href attribute (I think some validity checkers expect A tags to always have an href) you could instead use:

'" href="javascript:void(document.close())">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date

Attachments (0)
Change History (3)

Changed June 25, 2012 01:59PM UTC by scottgonzalez comment:1

component: ui.coreui.datepicker
owner: → jeremy
status: newpending

I'm not seeing this behavior. Are you experiencing problems on http://view.jqueryui.com/1.8.21/demos/datepicker/default.html ?

Changed July 10, 2012 08:29AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed May 18, 2017 10:35AM UTC by gimbar comment:3

I'm able to reproduce this issue.

Clicking on any date overwrites my anchor and resets my application. I don't know wether this matters but the anchor is seperated by a slash directly in front of it.