Sunday, 19 March 2017

How to add calendar date picker in html

                          Many times, while developing a website, we need to add Date field into our web page. An automatic generated date picker make it more user friendly and also improves the beauty of a web page.
                          In this post, we will see how to add calendar date picker in html web page.
                          Go through the following program code which uses Java Script to add datepicker to a webpage.

Program: (calender.html)

<title>Calender Sample Code</title>
<link rel="stylesheet" href="//">
<script src="//"></script>
<script src="//"></script>

$(function() {
$( "#datepicker" ).datepicker();


<form action="#" method="POST">
Event: <input type="text" name="subjectcode">
<br />
<br />

Date: <input type="text" name="date" id="datepicker" value="mm/dd/yyyy" onfocus="if(this.value==this.defaultValue) this.value='';" />
<br />
<br />

<input type="submit" value="Submit" />



No comments:

Post a comment