Skip to content

Commit

Permalink
Add console log for error
Browse files Browse the repository at this point in the history
  • Loading branch information
cwetanow committed May 25, 2017
1 parent 8b0e507 commit abf1590
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 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", OnFailure = "logError" },
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 @@ -60,6 +60,10 @@
<script type="text/javascript" src="/scripts/bootstrap-datetimepicker.js"></script>

<script type="text/javascript">
function logError(context) {
console.log(context);
}
$(function () {
$('#datetimepicker').datetimepicker({
format: 'DD/MM/YYYY'
Expand Down

0 comments on commit abf1590

Please sign in to comment.