我做了一个这样的脚本
$("#submit_butt").click(function(){
$("#error_messgae").html('');
//alert($("#deal_description").val().length);
if($("#deal_name").val()=="") {
var deal = "<li class='err-msg'>Deal Name is Blank</li>" ;
$("#error_messgae").html(deal);
$("#deal_name").css({'border':'1px solid red'});
} else {
$("#deal_name").css({'border':''});
} if($("#deal_price").val()==""){
var price = "<li class='err-msg'>Deal Price is Blank</li>" ;
$("#error_messgae").append(price);
$("#deal_price").css({'border':'1px solid red'});
}if(isNaN($("#deal_price").val())){
var price_num = "<li class='err-msg'>Deal Price Should be a Number</li>" ;
$("#error_messgae").append(price_num);
$("#deal_price").css({'border':'1px solid red'});
} else {
$("#deal_price").css({'border':''});
} if($("#category").val()==""){
var category = "<li class='err-msg'>Category is Blank</li>" ;
$("#error_messgae").append(category);
$("#category").css({'border':'1px solid red'});
} else {
$("#category").css({'border':''});
} if($("#deal_description").val()==""){
var description = "<li class='err-msg'>Deal Description is Blank</li>" ;
$("#error_messgae").append(description);
$("#deal_description").css({'border':'1px solid red'});
} if($("#deal_description").val().length<120){
var description_new = "<li class='err-msg'>Deal Description Should be more the 120 Characters</li>" ;
$("#error_messgae").append(description_new);
$("#deal_description").css({'border':'1px solid red'});
} else {
$("#deal_description").css({'border':''});
} if($("#deal_instructions").val()==""){
var instruction = "<li class='err-msg'>Deal Instruction is Blank</li>" ;
$("#error_messgae").append(instruction);
$("#deal_instructions").css({'border':'1px solid red'});
} else {
$("#deal_instructions").css({'border':''});
} if($("#deal_tags").val()==""){
var tags = "<li class='err-msg'>Deal Tags is Blank</li>" ;
$("#error_messgae").append(tags);
$("#deal_tags").css({'border':'1px solid red'});
} else {
$("#deal_tags").css({'border':''});
} if($("#deal_days").val()==""){
var deal_days = "<li class='err-msg'>Deal Days is Blank</li>" ;
$("#error_messgae").append(deal_days);
$("#deal_days").css({'border':'1px solid red'});
} if($("#deal_days").val()!="" && isNaN($("#deal_days").val())){
var deal_days_num = "<li class='err-msg'>Deal Days must be a Number</li>" ;
$("#error_messgae").append(deal_days_num);
$("#deal_days").css({'border':'1px solid red'});
} else {
$("#deal_days").css({'border':''});
}
});
现在我想在一切正常时提交我的表单。怎么做?