ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Datepicker set value issue
Title:
B
I
{code}
?
in one of your sample, you have a script like this: @(Html.Awe().DatePickerFor(o => o.DateTo).NumberOfMonths(2)) <script> $(function () { var from = $('#DateFrom'); var to = $('#DateTo'); from.change(function () { to.data('o').p.min = from.val(); }); to.change(function () { from.data('o').p.max = to.val(); }); }); In it, you're set the min value; do you have a way to set the value ? In my scenario, I have 2 date picker to manage subscription Start + End. My goal is to check value during the onchange of each control to be sure the End is always after to the Start. If not, I want to change the value of each control with the correct adjusted value.
Save Changes
Cancel
vRITHNER
asked at 08 Sep 2018
Answers
B
I
{code}
?
to set the value on any of our editor helpers you call $('#id').val(newVal).change(); trigger change to make the datepicker render in case of the example above: var val = from.val(); // get val from.val(newval).change(); // set val
Save Changes
Cancel
Omu
answered at 08 Sep 2018
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK