From 67ab931f57ce235760d12c4db3d35dec1b1c04a2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 5 Sep 2018 13:26:55 +0200 Subject: [PATCH] Added validation in edit and create --- js/site.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/site.js b/js/site.js index 29050be..1478c0c 100644 --- a/js/site.js +++ b/js/site.js @@ -45,9 +45,11 @@ $(document).ready(function() { $("#ajax_loader").hide(); $('#resultmodal').modal('show'); }); - }); - $("body").on("change", ".input[name=url]", function() { - $(".label[for=expected]").html("Capture services after reboot? (1: yes; 0: no)"); - $(".input[name=url]").attr("placeholder", "1"); - }) + }); + $("body").on("change", "input[name=url]", function() { + if($("input[name=url]").val() == "reboot") { + $(".label[for=expected]").html("Capture services after reboot? (1: yes; 0: no)"); + $("input[name=expected]").attr("placeholder", "1"); + } + }) });