Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#4783 closed bug (notabug)

datepicker and duplicate ids

Reported by: mbreaton Owned by:
Priority: minor Milestone:
Component: ui.datepicker Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

If a page contains elements with the same id and datepicker is assigned to both, selected dates are filled into the first element, even though the date picker drop down appears near the correct element.

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<title></title> <style type="text/css">

.date { }

</style>

<script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>

<script src="scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {

$('.date').datepicker();

});

</script>

</head> <body>

<form method="post" action="#"> <input type="text" class="date" id="date1" name="date" /><br /> <input type="text" class="date" id="date2" name="date" /><br /> <input type="submit" value="save" /> </form> <form method="post" action="#"> <input type="text" class="date" id="date1" name="date" /><br /> <input type="text" class="date" id="date2" name="date" /><br /> <input type="submit" value="save" /> </form>

</body> </html>

Change History (2)

comment:1 Changed 10 years ago by Scott González

Resolution: invalid
Status: newclosed

It's not valid to have multiple elements with the same id.

comment:2 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.