Removing empty Input Elements from a form

后端 未结 4 1168
梦如初夏
梦如初夏 2021-01-14 21:20

I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serializatio

4条回答
  •  醉酒成梦
    2021-01-14 22:04

        $('#send').click(function(){ 
    //---------------------------------------   
        $(":input").each(function() {
        if($(this).val() === "")
        alert("Empty Fields!!"); //using alert just to see if empty fields are detected.
        return false;
    });
    

    And you're not getting an error from this? The first lambda's scope isn't closed.

    Use Firebug to highlight errors that you might be getting and post those.

提交回复
热议问题