How to validate when certain fields not filling?
I have few input with class=”string” and submit button.
When user press button, display alert box, message with the name of field which not filled.
An example, if two fields not filling show alert with 2 string: fieldname1 not filled, fieldname2 not filled.
$(“.string”).each() should iterate through all elements with class string. Inside it tou can put some if that will be checking values of inputs ( if ($(this).val == “”){}), and you can store fieldnames inside some array or string.
Example:
will show an alert with indexes of inputs that are not filled