currently I have an Html form with javascript validation. Currently the errors are showing in a popup by using the alert command.... how I can display error messages next to the text boxes please? Below is my current code:
if (document.gfiDownloadForm.txtFirstName.value == '') {
alert('Please fill in all required fields');
return false;
}
var filter = /^([a-zA-Z '-]+)$/i
if (filter.test(document.gfiDownloadForm.txtFirstName.value) == false) {
alert('Please enter a valid First name');
return false;
}
var filter = /^([a-zA-Z '-]+)$/i
if (filter.test(document.gfiDownloadForm.txtLastName.value) == false) {
alert('Please enter a valid Last name');
return false;
}
if (document.gfiDownloadForm.txtCompany.value == '') {
alert('Please enter a Company name');
return false;
}