diff options
Diffstat (limited to 'esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js')
-rw-r--r-- | esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js b/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js index 56f22c2..1c9b7bd 100644 --- a/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js +++ b/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js @@ -107,7 +107,9 @@ var vm = avalon.define({ }, $saveSDNC: function () { var form = $('#vnfm_form'); - //TODO valiate + if(!vm.validate()){ + return; + } vm.server_rtn.info_block = true; vm.server_rtn.warning_block = false; @@ -128,6 +130,18 @@ var vm = avalon.define({ vm.currentElement = vm.sdncList[index]; vm.$showTable(); }, + validate: function () { + var res = true; + var sdncSave = vm.getSDNCSave(); + var url = sdncSave.url; + if(!vm.$format.url.test(url)){ + $("#form_sdnc input[name='url']").next().html("The url format is incorrect"); + res = res && false; + } else { + $("#form_sdnc input[name='url']").next().html(""); + } + return res; + }, delSDNC: function (id, index) { bootbox.confirm($.i18n.prop("nfv-sdnc-iui-message-delete-confirm"), function (result) { if (result) { |