Skip to content Skip to sidebar Skip to footer

Check Hidden Form Input Has Value On Form Submit

I have a form with a hidden input: I have a hidden Alert (using Bootstrap for this): The hidden form input is

Solution 1:

Basically you will want to check the value on submit using an if statement

$("form").submit(function(event) {

     event.preventDefault();

     if($('#productID').val() == '') {

          $("#alert_ajax_error").show();

          return false;

     }

     //.... more form actions if good ....

});

Post a Comment for "Check Hidden Form Input Has Value On Form Submit"