差的资。料说是用ajax做?可是我不会ajax,ajax实在不会写了。。。
html部分
"
maxlength="50" />
javascript部分
后台数据库代码
@RequestMapping(value = "/repeat")
public void repeat(HttpServletRequest request, HttpServletResponse response, String custom_number) throws SQLException, IOException{
ConnectionSource connectionSource = DBUtil.getConnectionSource();
Dao dao = DaoManager.createDao(connectionSource,
zqbp_custom.class);
QueryBuilder where = dao.queryBuilder();
List list = where.where().eq("custom_number", custom_number).query();
if(list.size()==0){
}else {
response.getWriter().write("编号重复,请重新输入");
response.getWriter().close();
}
}
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
jquery validation找个这个来用
当然自己做也没什么难的 最多做的丑一点