How do I pass string value to alert message for each empty field?
I have w, t, a, c and s. For example, if w is empty, it should give the alert message "Mandatory field w must be filled out". And same goes for others.
My javascript:
function addvalidation(){
var w = document.forms["shop"]["w"].value;
var t = document.forms["shop"]["t"].value;
var a = document.forms["shop"]["a"].value;
var c = document.forms["shop"]["c"].value;
var s = document.forms["shop"]["s"].value;
var c = document.forms["shop"]["c"].value;
if (w == "" || t =="" || a == ""|| c == "" || s == "" || c == "") {
alert("Mandatory fields must be filled out");
return false;
}
ifcondition for each variables?