Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8498 closed bug (notabug)

date picker show error with same input control with same id in different forms in one html file

Reported by: [email protected] Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.22
Keywords: Cc:
Blocked by: Blocking:

Description

date picker show error with same input control with same id in different forms in one html file

for first input it shows correct value but for second input control it updates value of first input control

sample html file

<!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> <script src="../jScr/jquery-min.js" type="text/javascript"></script> <script src="../jScr/jquery-ui-min.js" type="text/javascript"></script> <script src="../jScr/jquery-ui-timepicker-addon.js" type="text/javascript"></script> <script type="text/javascript" language="javascript">

$(document).ready(function () {

$('.dt').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: 'hh:mm' }).attr('size', 17); .empty_value($.get(wSer + "/GetDate", { format: '1' }, function (data) { alert(data); $(this).val(data); }), false, );

});

</script>

</head> <body>

<form action="">

<input id="test" type="text" class="dt" />

</form> <form action="">

<input id="test" type="text" class="dt" />

</form>

</body> </html>

Change History (4)

comment:1 Changed 11 years ago by [email protected]

please check this code...

<!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> <script src="../jScr/jquery-min.js" type="text/javascript"></script> <script src="../jScr/jquery-ui-min.js" type="text/javascript"></script> <script src="../jScr/jquery-ui-timepicker-addon.js" type="text/javascript"></script> <script type="text/javascript" language="javascript">

$(document).ready(function () {

$('.dt').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: 'hh:mm' }).attr('size', 17); });

</script>

</head> <body>

<form action="">

<input id="test" type="text" class="dt" />

</form> <form action="">

<input id="test" type="text" class="dt" />

</form>

</body> </html>

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

Component: ui.coreui.datepicker
Resolution: invalid
Status: newclosed

That's not valid HTML.

comment:3 in reply to:  2 Changed 11 years ago by [email protected]

Replying to scott.gonzalez:

That's not valid HTML.

Can you please tell me why & where?

comment:4 Changed 11 years ago by Scott González

IDs must be unique. Please use a support forum for help.

Note: See TracTickets for help on using tickets.