Home > Web Front-end > JS Tutorial > body text

My97DatePicker default assignment

黄舟
Release: 2017-02-18 13:40:54
Original
2363 people have browsed it

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>
Copy after login


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)!



Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!