Hi All I am trying to do a simple jQuery, where in the selector fetches me all the empty fields in the form page.
var inputFieldsArray = $(":input:not(:hidden)"); // to get the fields that arent hidden for(var i=0; i<inputFieldsArray.size(); i++){ var trClass = $ (inputFieldsArray[i]).parents("tr:first").attr("class"); if (trClass == "wcgRequired wcgErrorRow") { // if this value then set wcgFieldtype as required if ($(inputFieldsArray[i]).attr("class") != 'wcgFieldNotRequired') { $(inputFieldsArray[i]).attr("wcgFieldType", "required"); if (($(inputFieldsArray[i]).attr("value") == undefined)||($ (inputFieldsArray[i]).attr("value") == null)||($ (inputFieldsArray[i]).attr("value").trim().length == 0) ) // if this is true then set wcgFieldState = empty { $(inputFieldsArray[i]).attr("wcgFieldState", "empty"); var requiredButEmpty = $(":input[wcgFieldState='empty']"); alert("requiredButEmpty" +requiredButEmpty.length.toString()); // this value is always 0 in case of IE but FF fetches me the right value } I have included the inline comments for better understanding. I have been struggling with this for almost a week and I am unable to find the root cause Any help in this regard is greatly appreciated thank you Anuradha K