I have several text fields on the page, imagine 10, 4 of these 10 have the class "myClass". I would like to know if ALL of these text fields with class "myClass" have length = 0, in one line the command
Possible?
Thanks,
Update1
function MyValidation() { var res = true; if (!$("input:text.MyClass[value!='']").length) { alert("testing"); res = false; } return res; }
When you get this code, I get โtrueโ all the time, never โfalseโ and never โcheckโ. I tried the code for each answer.
source share