[html]html常用代码

时间:2021-03-03 12:30:59

上传文件表单属性

enctype="multipart/form-data"

单选(是否选中)

checked="checked"

下拉列表(是否选中)

selected="selected"

加密

@Autowired
private PwdEncoder pwdEncoder;
pwdEncoder.encodePassword(password);

ajax

function chkOldPwd() {
var Pwd = $("#old_pwd").val();
var Mid = $("#hdfMid").val(); if (Pwd != "") {
var params = {"userId":Mid,"password":Pwd}; //此处参数名要注意和后台方法参数名要一致
$.ajax({
type : "POST",
url : "${base}/doctor/isexist.jspx",
data : params,
dataType : "json",
//contentType : "application/json; charset=utf-8",
success : function(data) {
if (data.message == "true") {
$("#oldpwd_notice").css("color", "green");
$("#oldpwd_notice").html("原密码输入正确");
} else {
$("#oldpwd_notice").css("color", "red");
$("#oldpwd_notice").html("原密码输入错误");
}
},
error : function(err) {
alert("错误");
}
});
} else {
$("#oldpwd_notice").css("color", "red");
$("#oldpwd_notice").html("请输入原密码");
}
}