我开发了以下代码,点击搜索按钮检查学生ID的可用性,但无法进行验证,plz在这方面的帮助 我有以下代码:
$("#stud1search").click(function(e) {
var id = $('#studentidd').val();
if(id!="")
{
jQuery.ajax({
type: "GET",
url: '../jsp/admin/master/Studentinfo.jsp?stdid='+id,
async: false,
cache: false,
success: function(msg) {
if($.trim(msg)==1)
{
$('#searchkaro').html("Student Id: Student Id already exist");
}
else
{
$("#studentmother").html(msg);
$("#searchkaro").load("../jsp/admin/master/Studentinfo.jsp");
//$("#searchkaro").val("");
}}
}); }
else
{
$('#searchkaro').html("Enter Student Id");
}
});
答案 0 :(得分:0)
也许你不想要
var id = $('#studentidd').val();
但
var id = $('#studentid').val();
很难知道没有看到你的HTML