JSFiddle - React, Tailwind, and code Playground
HTML
<input type="image" name="ImgAttach" id="ImgAttach" src="../Images/attachment_1.png" onclick="return Imgclick();" />
<input type="submit" name="CmdSave" value="Save" onclick="return FunSaveValidate();" id="CmdSave" class="button" />
JavaScript
function FunSaveValidate() {
var ErrorMsg = "";
if (document.getElementById('ddlProject').value == "0" || document.getElementById('ddlProject').value == "") {
ErrorMsg += "Select Project \n";
}
if (document.getElementById('txtlegalEnt').value == null || document.getElementById('txtlegalEnt').value == "") {
ErrorMsg += "Legal Entity cannot be blank \n";
}
if (document.getElementById('ddlVillage').value == "0" || document.getElementById('ddlVillage').value == "") {
ErrorMsg += "Select Village \n";
}
if (document.getElementById('txtSurvey1').value == null || document.getElementById('txtSurvey1').value == "") {
ErrorMsg += "Survey no cannot be blank \n";
}
if (document.getElementById('txtHissa').value == null || document.getElementById('txtHissa').value == "") {
ErrorMsg += "Hissa no cannot be blank \n";
}
if (document.getElementById('txtGuntha').value == null || document.getElementById('txtGuntha').value == "") {
ErrorMsg += "Area(Guntha) cannot be blank \n";
}
if (document.getElementById('txtMobile').value == null || document.getElementById('txtMobile').value == "") {
ErrorMsg += "Mobile no cannot be blank \n";
}
if (ErrorMsg != "") {
alert(ErrorMsg);
return false;
}
else {
return true;
}
}