0

I'm trying to validate input fields when the value is empty. I want to only target input fields using a certain class. I have tried to use .hasClass("required") without any success.

I hope somebody can help.

EDIT = Should of pasted the rest.

2
  • You wrote all that but you don't know how to select by class?! $('.className')... Commented Feb 21, 2012 at 18:13
  • if $(this).hasClass("required")... What's the problem? I'm having difficulties to understand where is your problem. Commented Feb 21, 2012 at 18:43

1 Answer 1

1

from:

$('input').each(function() {

to:

$('input.yourclassname').each(function() {
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.