Home  >  Article  >  Web Front-end  >  My97DatePicker default assignment

My97DatePicker default assignment

黄舟
黄舟Original
2017-02-18 13:40:542320browse

1. Problem background

My97DatePicker is opened by default in the system and needs to be assigned a value. Use its own startDate attribute to set it. Use the focus event when switching calendars. The result is Tested on Firefox browser, stuck phenomenon occurs.


2. Implementation source code

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>My97DatePicker默认赋值</title>
		<script type="text/javascript" src="js/jquery-1.12.3.js" ></script>
		<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
		<script>
			$(function(){
				$("#startDate").val($("#initDate").val());
				$("#startDate").off().on("focus",function(){
					var startDate = $(initDate).val();
					WdatePicker({startDate:startDate});
				});
			});
		</script>
	</head>
	<body>
		<input type="text" id="initDate" value="2015-06-20"/><br><br>
		<input type="text" id="startDate" class="Wdate" onClick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;,alwaysUseStartDate:true})"/>
	</body>
</html>


3. Achievement results

My97DatePicker default assignment

##4. Problem description

The above is the content assigned by My97DatePicker by default. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn