From d69c30aa6153d2fd79d9b3a936102235589f86cd Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Sat, 29 Sep 2018 06:55:31 +0300 Subject: [PATCH] Use specific function to check form --- code/html/custom.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/html/custom.js b/code/html/custom.js index ba542dd6..e651ff5c 100644 --- a/code/html/custom.js +++ b/code/html/custom.js @@ -205,8 +205,7 @@ function validateFormHostname(form) { var re_hostname = new RegExp('^(?!-)[A-Za-z0-9-]{0,30}[A-Za-z0-9]$'); var hostname = $("input[name='hostname']", form); - var hasChanged = ("true" === hostname.attr("hasChanged")); - if (!hasChanged) { + if ("true" !== hostname.attr("hasChanged")) { return true; } @@ -496,7 +495,7 @@ function doUpgrade() { function doUpdatePassword() { var form = $("#formPassword"); - if (validateForm(form)) { + if (validateFormPasswords(form)) { sendConfig(getData(form)); } return false;