Hi, I had just put in a jquery datepicker, but i got no idea how to get the selected date and store it in database. Here is my view:
<%--Try Jquery UI here--%>
<script type="text/javascript" src="../../../JQuery/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../../../JQuery/js/jquery-ui-1.8.11.custom.min.js"></script>
<script type="text/javascript">
$
('#date').datepicker();
</script>
<%--End Jquery Ui here--%>
<p>
<%: Html.LabelFor(model => model.FoodStoreDate) %>
<input type="text" name="date" id="date" />
<%: Html.ValidationMessageFor(model => model.FoodStoreDate) %>
</p>
<p>
<%: Html.LabelFor(model => model.FoodExpiryDate) %>
<%: Html.EditorFor(model => model.FoodExpiryDate) %>
<%: Html.ValidationMessageFor(model => model.FoodExpiryDate) %>
</p>
Initially i am using the Html editor for (as for the foodexpirydate) to pass back the date enterred by user to the database. However, now i try to use the date picker to let user choose the date. Currently the date picker shown, but after i choose the date and save, the value is not save in database. Is it because the date format different? or actually i need to add some jquery code to pass back the selected date??
Any help will be really appreciated...
Thanks...