138
rated 0 times
[
145]
[
7]
/ answers: 1 / hits: 46019
/ 11 Years ago, fri, august 9, 2013, 12:00:00
I am using this amazing javascript to check if all my fields are filled in, but instead of a alert box I want to show a message on my page.
$(document).ready(function() {
$('form').submit(function() {
var incomplete = $('form :input').filter(function() {
return $(this).val() == '';
});
//if incomplete contains any elements, the form has not been filled
if(incomplete.length) {
alert('Vul alle velden in en probeer het nog eens');
//to prevent submission of the form
return false;
}
});
});
I tried to play with echo messages but it didn't work.
More From » forms