Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how can prevent the empty input in jquery

$('#form').submit(function() {
    if ($.trim($("#email").val()) === "" || $.trim($("#user_name").val()) === "") {
        alert('you did not fill out one of the fields');
        return false;
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #empty #input #jquery
ADD COMMENT
Topic
Name
4+2 =