Validation plugin group problem
<div dir="ltr">Hello,
I am using JQuery - 1.2.3 along with jquery.validate.js - 1.4pre.
I am having a problem with group validation of fields. The error messages are being shown prematurely without giving the user an opportunity to submit the form. The page where I have this problem is : <a href="https://www.bankbazaar.com/personalloans/eligibility.html">https://www.bankbazaar.com/personalloans/eligibility.html</a>.
In over there, I am validating the field group with label "When did you move to this city". As I select the Year, the field is being validated which I believe is the normal behaviour. But under normal circumstances, the error would not be shown. In this case, it is being shown. I did some digging but couldnt arrive at the reason. Part of my configuration is as follows :
groups : {
validStartDate : "eFrm_form_startTimeInResidence_year eFrm_form_startTimeInResidence_month",
validStartDate : "eFrm_form_startTimeInCity_year eFrm_form_startTimeInCity_month"
},
.........
function validStartDate(value, input)
{
var dtContainer = $(input).parent().find("select");
var year = $(dtContainer[0]);
var month = $(dtContainer[1]);
var valid = true;
valid = year.val().length > 0 && valid;
valid = (year.find("option:last:selected").length == 1 || month.val().length > 0) && valid;
if(valid)
{
cleanStartDate(input);
}
return valid;
}
......
the fields are as follows :
<div class="startDater">
<select class="requiredStartDate error" id="eFrm_form_startTimeInCity_year" name="form.startTimeInCity.year">
<option class="gray_header" value="">YYYY</option>
<option value="2008">2008</option>.... <option value="2003">Before 2004</option>
</select>
<select class="requiredStartDate" id="eFrm_form_startTimeInCity_month" name="form.startTimeInCity.month">
<option class="gray_header" value="">MMM</option>
<option value="1">Jan</option>...... <option value="12">Dec</option>
</select><br clear="all">
--
Thanks
Ram
</div>