当前位置:网站首页>SMS verification before deleting JSP

SMS verification before deleting JSP

2022-06-25 11:42:00 Duxiaolie

scene : After deletion, first judge whether the user has checked the data to be deleted , Make a pop-up window and verify the SMS or mobile number first .

/** * 1, pop-up  */
function myFunction() {
    
	var bol = $("input[type='checkbox']").is(':checked')
	if(bol==false){
    
		alert(' Select at least one delete ');
		return ;
	}
	
	var email = '${userMap.email}';
	var sms = '${userMap.mobile}';
	console.log(" I got all the values , Why can't I render it ?"+"${userMap}"); 
	if(email!=null||email!=''){
    
		$('#emailoption').removeAttr("hidden"); // removeAttr()  Method to remove the attribute from the selected element .
		$('#emailoption').attr("selected", "selected"); //  Setting property values 
		$('#authentication_type').html('<liferay-ui:message key="login.factor.email"/>:'); 
		$('#personFaInfo').val(email.substring(0,3)+"***"+email.substring(email.length-3,email.length));
	}else{
    //  Purpose : If the phone number is not empty , It is selected by default , And do desensitization treatment .( Need to send ( Submit ), Display is the value of desensitization , Submit with real values .)
		if(sms!=null||sms!=''){
    
			$('#smsoption').removeAttr("hidden");
			$('#smsoption').attr("selected", "selected");
			$('#authentication_type').html('<liferay-ui:message key="login.factor.sms"/>:');
			$('#personFaInfo').val(sms.substring(0,3)+"***"+sms.substring(sms.length-3,sms.length));
		}
	}
	$('#portsuccess').show(); //  Exhibition ,
	$('.login_common_pop').show();
}

 Summary :
	1,jsp in ,"${userMap}"  and  "${requestScope.userMap}" The same usage .
		console.log("${userMap}"); 
		console.log("${requestScope.userMap}");
	2,$('#emailoption').removeAttr("hidden"); // removeAttr()  Method to remove the attribute from the selected element .
	3,$('#emailoption').attr("selected", "selected"); //  Set properties . You can also set multiple properties .
	4, Tips for handling desensitization data , Desensitization value uses a value , The value to be submitted shall be the value without desensitization .
	5,.show()  Exhibition ; .hide()  hide ,  Corresponding css style="display: none;".

www.w3school.com.cn Website :https://www.w3school.com.cn/jquery/index.asp

原网站

版权声明
本文为[Duxiaolie]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200536132611.html