i have form collection and 5 input type = “text” with different Id and 1 submit button like
<form id="frmSubmitSupplier" method="post">
<input type="text" id="txtCompanyName" name="companyname" />
<input type="text" id="txtFirstName" name="firstname" />
<input type="text" id="txtLastName" name="lastname" />
<input type="text" id="txtAdd1" name="address1" />
<input type="text" id="txtCity" name="city" />
<input id="btnSupplierSave" type="submit" value="Save"/>
</form>
in jquery code i want to put if condition for all blank textboxes like
$('#frmSubmitSupplier').live('submit', function (e) {
i want to check here that if all textboxes are empty then any alert but in only single line.. how to check
});
You can’t do it in a single line, unless you want it to be unreeadable. You have to iterate over all input’s and check their value.
CSS:
JS: