Unable to show datetime value into textbox in mvc
I worte code like this
i'm refering following JS
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
this how i implemented on the code
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
<div class='input-group date' id='startDatepicker'>
@Html.TextBoxFor(c => c.StartDT,new { @class = "form-control", @id = "StartDT"})
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
and it's binding values from model
but it's not showing in textbox value
help me to fix this problem
asp.net-mvc asp.net-mvc-4 jquerydatetimepicker
|
show 3 more comments
I worte code like this
i'm refering following JS
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
this how i implemented on the code
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
<div class='input-group date' id='startDatepicker'>
@Html.TextBoxFor(c => c.StartDT,new { @class = "form-control", @id = "StartDT"})
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
and it's binding values from model
but it's not showing in textbox value
help me to fix this problem
asp.net-mvc asp.net-mvc-4 jquerydatetimepicker
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.
– Richard
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
1
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the<input>
, you're using the id of the parent<div>
.
– Richard
Nov 21 '18 at 11:55
|
show 3 more comments
I worte code like this
i'm refering following JS
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
this how i implemented on the code
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
<div class='input-group date' id='startDatepicker'>
@Html.TextBoxFor(c => c.StartDT,new { @class = "form-control", @id = "StartDT"})
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
and it's binding values from model
but it's not showing in textbox value
help me to fix this problem
asp.net-mvc asp.net-mvc-4 jquerydatetimepicker
I worte code like this
i'm refering following JS
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
this how i implemented on the code
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
<div class='input-group date' id='startDatepicker'>
@Html.TextBoxFor(c => c.StartDT,new { @class = "form-control", @id = "StartDT"})
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
and it's binding values from model
but it's not showing in textbox value
help me to fix this problem
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="~/Content/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="@Url.Content("~/Content/js/jquery-1.11.1.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Content/js/moment.min.js")"></script>
<script src="@Url.Content("~/Content/js/bootstrap-datetimepicker.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
$(function () {
$('#startDatepicker').datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
$('#EndDatepicker').datetimepicker({
useCurrent: false, //Important! See issue #1075
format: 'YYYY-MM-DD HH:mm',
});
$("#startDatepicker").on("dp.change", function (e) {
$('#startDatepicker').data("DateTimePicker").minDate(new Date());
});
$("#EndDatepicker").on("dp.change", function (e) {
$('#EndDatepicker').data("DateTimePicker").minDate(new Date());
});
});
asp.net-mvc asp.net-mvc-4 jquerydatetimepicker
asp.net-mvc asp.net-mvc-4 jquerydatetimepicker
edited Nov 21 '18 at 11:40
silambarasan vediappan
asked Nov 21 '18 at 10:22
silambarasan vediappansilambarasan vediappan
809
809
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.
– Richard
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
1
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the<input>
, you're using the id of the parent<div>
.
– Richard
Nov 21 '18 at 11:55
|
show 3 more comments
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.
– Richard
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
1
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the<input>
, you're using the id of the parent<div>
.
– Richard
Nov 21 '18 at 11:55
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.– Richard
Nov 21 '18 at 10:34
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.– Richard
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
1
1
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the
<input>
, you're using the id of the parent <div>
.– Richard
Nov 21 '18 at 11:55
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the
<input>
, you're using the id of the parent <div>
.– Richard
Nov 21 '18 at 11:55
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409924%2funable-to-show-datetime-value-into-textbox-in-mvc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409924%2funable-to-show-datetime-value-into-textbox-in-mvc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
i had set default datetime also, but same issue happening
– silambarasan vediappan
Nov 21 '18 at 10:31
jQueryTimePicker
requires some JavaScript to operate: please show a complete re-create of your problem.– Richard
Nov 21 '18 at 10:34
thanks for you response @Richard, even i bind as text also getting same issue
– silambarasan vediappan
Nov 21 '18 at 10:34
Comments make that too hard to read, please edit the question.
– Richard
Nov 21 '18 at 10:48
1
The examples xdsoft.net/jqplugins/datetimepicker show the initialisation using the id of the
<input>
, you're using the id of the parent<div>
.– Richard
Nov 21 '18 at 11:55