-4
我想在html中使用表單驗證以及datepicker。由於衝突它不起作用。請幫忙。這是我的代碼。如何在同一個html中使用2個不同版本的jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function() {
$("#form1").validate({
rules: {
asset_name: 'required',
asset_code: 'required',
asset_desc: 'required',
purchase_date: 'required'
}
});
});
</script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript">
jQuery.noConflict();
$(function() {
$("#purchase_date").datepicker({ dateFormat: 'yy-mm-dd' });
});
$(function() {
$("#renewal_date").datepicker({ dateFormat: 'yy-mm-dd' });
})(jQuery);
</script>
任何可能的原因,不使用jQuery驗證最新版本? – 2013-04-09 05:58:08