问题
How can i able to use multiple instances of date picker? One date picker is working but the next instance of date picker is invoking the same popup, how to proceed? Can anyone give me your Email Id...I will mail you the whole code...then you will be able to get the whole idea in better way
http://jsfiddle.net/premseoul/BjDYP/
Whole set of codes are available at the link in a Zip ..please download the zip..... http://www.4shared.com/file/ZQy2A3DU/DateTime.html
回答1:
http://jsfiddle.net/d4Aqz/
$( "#datepicker" ).datepicker();
$( "#datepicker2" ).datepicker();
回答2:
window.onload = function(){
new JsDatePick({
useMode:2,
target:"inputField1",
dateFormat:"%Y-%m-%d"
/*selectedDate:{ This is an example of what the full configuration offers.
day:5, For full documentation about these settings please see the full version of the code.
month:9,
year:2006
},
yearsRange:[1978,2020],
limitToToday:false,
cellColorScheme:"beige",
dateFormat:"%Y-%M-%d",
imgPath:"img/",
weekStartDay:1*/
});
};
but the function is called this way
回答3:
i dont know what you mean. But if you have multiple datepicker you must use class.
<script>
$(function() {
$(".datepicker").datepicker({ dateFormat:'yy-mm-dd'});
});
</script>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="300">Problem Date</td>
<td width="10">:</td>
<td width="150" align="left">
<input type="text" id="datepicker" name="prob_date" class="datepicker">
</td>
</tr>
<tr>
<td width="300">Eff. Date</td>
<td width="10">:</td>
<td width="150" align="left">
<input type="text" id="datepick" name="eff_date" class="datepicker">
</td>
</tr>
</table>
来源:https://stackoverflow.com/questions/5673353/multiple-instances-of-date-picker