JSFiddle - React, Tailwind, and code Playground
HTML
<form name="workshop" onsubmit="return updatevalidation()"> <tr>
<td><input type="text" name="a" path="name"/></td>
<td> <input name="b" type="contact" path="contact"/></td>
<td><input type="text" path="contact2" name="c"/></td>
<td><input type="text "path="contactfax" name="d"/></td>
<td><input type="text" path="fax" name="e"/></td>
<td ><input type="text"path="location"name="f" /></td>
<td class="button">
<input type="submit" value="Update" style=" margin: 0 auto;"/>
</td>
</tr>
</form>
JavaScript
function updatevalidation() {
var form = document.forms["workshop"];
var ef = ['a', 'b', 'c', 'd', 'e', 'f'].filter(function (f) {
return !form[f].value
})
if (ef.length) {
alert("Mandatory field(s) for " + ef.join() + " must be filled out");
return false;
}
}