Here is a simple jQuery script which could use the validate a mandatory input.
(function ($) {
$(document).ready(function() {
$('#<submit-button-id>').click(function(event){
var x = $('<input-id>').val();
if (x == null || x == '';) {
alert('Please fill in the input.');
event.preventDefault();
}
})
});
})(jQuery);
Done =)
Reference: StackOverflow – Intercept a click on submit button and check validity of form jQuery
