i'm using a calendar and I need to pass the value from it into my model to be submitted back to the controller but i'm stuck.
View
<div class="cell">
@Html.LabelFor(model => model.ExpectedDatetimeStamp, new { @class = "control-label col-md-2" }):
<div data-role="calendar" data-week-start="1" data-multi-select="false" id="c1" class="calendar"></div>
<div hidden>@Html.EditorFor(model => model.ExpectedDatetimeStamp)</div>
<div>
@Html.ValidationMessageFor(model => model.ExpectedDatetimeStamp)
</div>
</div>
<div>
<input type="submit" value="Create" class="button primary" />
</div>
JS
function get_dates(){
var result = $("#c1").calendar('getDates');
alert(result);
}
how can I assign the value from result to model.ExpectedDatetimeStamp when the user presses the submit button?
$('#ExpectedDatetimeStamp').val(result);