diff options
-rw-r--r-- | esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js | 16 | ||||
-rw-r--r-- | esr/src/main/webapp/extsys/sdncontroller/sdncView.html | 3 |
2 files changed, 16 insertions, 3 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) { diff --git a/esr/src/main/webapp/extsys/sdncontroller/sdncView.html b/esr/src/main/webapp/extsys/sdncontroller/sdncView.html index 3cd78a5..6bcb68f 100644 --- a/esr/src/main/webapp/extsys/sdncontroller/sdncView.html +++ b/esr/src/main/webapp/extsys/sdncontroller/sdncView.html @@ -40,7 +40,7 @@ </div> <div class="modal-body"> <div class="step-content"> - <form class="form-horizontal" role="form"> + <form class="form-horizontal" role="form" id="form_sdnc"> <div class="form-group"> <label class="control-label col-sm-3"> <span>Name</span> @@ -59,7 +59,6 @@ <div class="col-sm-7"> <input type="text" ms-duplex="currentElement.url" name="url" class="form-control"/> <span class="help-block"></span> - <span class="help-block"></span> </div> </div> <div class="form-group"> |