TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nepethya Rana
NA
335
151.2k
could not able to render current date in textbox - Jquery
Aug 11 2017 10:15 AM
I have input text box for date. I am using JQuery Date picker.
I want to set and render the current date in my text box when page loads as default.
I could not able to do it. This is my code. Its not working.
Please look at and help me out.
<label for="dateSelection">Date:</label>
<span style="background-color: antiquewhite; padding-top: 3.6px; padding-bottom: 3.6px;">
<input type="text" id="dtID" name="dateSelection" placeholder="mm/dd/yyyy" ng-model="txtDate" required />
<span class="glyphicon glyphicon-calendar" style="padding-right: 3.6px;"></span>
</span>
$(document).ready(function () {
$('#dtID').datepicker({
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
duration: 'fast',
dateFormat: 'mm/dd/yy',
onSelect: function (date) {
$scope.txtDate = date;
$scope.$apply();
}
}).setDate(new Date());
});
Reply
Answers (
2
)
add data in textbox
how to access JSON properties ( to get the value