Skip to content

Commit

Permalink
Submit form in load
Browse files Browse the repository at this point in the history
  • Loading branch information
cwetanow committed May 25, 2017
1 parent 6f559ac commit 151e1e2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Logs.Web/Views/Nutrition/Input.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<ul class="list-inline intro-social-buttons">
<li>
@using (Ajax.BeginForm("Load", "Nutrition",
new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "nutrition" },
new { @class = "form-horizontal form col-md-12 center-block", role = "form", id = "nutrition-form" }))
new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "nutrition" },
new { @class = "form-horizontal form col-md-12 center-block", role = "form", id = "nutrition-form" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.Date, new { id = "nutrition-model-date" })
Expand All @@ -31,8 +31,8 @@
<li>

@using (Ajax.BeginForm("Load", new { controller = "Measurement" },
new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "measurements" },
new { @class = "form-horizontal form col-md-12 center-block", role = "form", id = "measurement-form" }))
new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "measurements" },
new { @class = "form-horizontal form col-md-12 center-block", role = "form", id = "measurement-form" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.Date, new { id = "measurements-model-date" })
Expand Down Expand Up @@ -65,6 +65,8 @@
format: 'DD/MM/YYYY'
});
$('#nutrition-form').submit();
$('#datetimepicker').on("dp.change", function (e) {
var date = $('#datetimepicker').val();
$('#nutrition-model-date').val(date);
Expand Down

0 comments on commit 151e1e2

Please sign in to comment.