Friends,
I have a form as below;
<form method="post" id="contact_form" action="">
<label for="name">Name</label>
<input type="text" name="name" id="name" />
<label for="email">Email</label>
<input type="text" name="email" id="email" />
<label for="purpose">Purpose</label>
<input type="text" name="purpose" id="purpose" />
<input type="submit" value="Submit"/>
</form>
When I submit the form, I want to identify and add a class called 'error' for only the labels of inputs which having empty values using jQuery.
Please help me short this problem.
Thanks and regards, Rushenn.
Try this: