From 911e65ca7d4f47ec18212375b4eb479c1c40acbe Mon Sep 17 00:00:00 2001 From: wyu <kknd09321@nate.com> Date: 금, 07 1월 2022 10:03:18 +0900 Subject: [PATCH] 연락처 입력시 하이픈 자동 입력 (지역, 핸드폰 번호) --- src/main/webapp/scripts/app/user/userAdd.controller.js | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/scripts/app/user/userAdd.controller.js b/src/main/webapp/scripts/app/user/userAdd.controller.js index 851e786..c2a5bb8 100644 --- a/src/main/webapp/scripts/app/user/userAdd.controller.js +++ b/src/main/webapp/scripts/app/user/userAdd.controller.js @@ -15,7 +15,7 @@ formSubmit : formSubmit, // �뤌 �쟾�넚 formCheck : formCheck, // �뤌 泥댄겕 onFileSelect : onFileSelect, // �봽濡쒗븘 �뾽濡쒕뱶 - autoHypenPhone : autoHypenPhone // �뿰�씫泥� �엯�젰�떆 - �옄�룞 �엯�젰 + autoHyphenPhone : autoHyphenPhone // �뿰�씫泥� �엯�젰�떆 �븯�씠�뵂 �옄�룞 �엯�젰 }; $scope.vm = { @@ -45,11 +45,13 @@ } } - // �뿰�씫泥� �엯�젰�떆 - �옄�룞 �엯�젰 - function autoHypenPhone() { + // �뿰�씫泥� �엯�젰�떆 �븯�씠�뵂 �옄�룞 �엯�젰 + function autoHyphenPhone() { + // �빖�뱶�룿 踰덊샇 議곌굔 var str = $scope.vm.form.phone str.replace(/^[0-9]/g, ''); var tmp = ''; + if (str.length < 4) { return str; } else if (str.length < 7) { @@ -75,6 +77,7 @@ return str } + // �뤌 泥댄겕 function formCheck(formInvalid) { if (formInvalid) { return true; @@ -99,6 +102,7 @@ return false; } + // �뤌 �쟾�넚 function formSubmit() { $rootScope.spinner = true; // �봽濡쒓렇�옒�뒪 諛� @@ -107,7 +111,7 @@ content.workspaceName = $rootScope.preventXss(content.workspaceName); content.password = CryptoJS.SHA512(content.password).toString(); content.language = $rootScope.language; // 湲곕낯 �뼵�뼱 - content.phone = content.phone.replace(/\-/g,''); + content.phone = content.phone.replace(/\-/g,''); // �쟾�솕踰덊샇瑜� 蹂대궪�븧 �븯�씠�뵂�쓣 �젣嫄고빐�꽌 DB�뿉 ���옣 User.add({ method : "POST", -- Gitblit v1.8.0