This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateEmail(email){ | |
var emailReg = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); | |
return emailReg.test(email); | |
} | |
function validatePhone(phone){ | |
var phoneReg = new RegExp(/((09|03|07|08|05)+([0-9]{8})\b)/g); | |
return phoneReg.test(phone); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.modal.Constructor.prototype.enforceFocus = function () { | |
modal_this = this | |
$(document).on('focusin.modal', function (e) { | |
if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length | |
// add whatever conditions you need here: | |
&& | |
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_select') && !$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) { | |
modal_this.$element.focus() | |
} | |
}); |
NewerOlder