Jquery validation not properly working
Hi,
I have the following HTML file associated with a jquery validation. See below
My issue is i can submit the from if both text field are not empty but when I click the check box, i'm not supposed to be prompted to enter arrival and departure time and that's what's happening. any help will be appreciated.
function submitMyForm() {
if(!fieldValidation())
{
return;
}
else {
fillBackDate();
document.myForm.submit();
}
}
function fieldValidation()
{
if (!($("_1_1_17_1").is(':checked')) && ($("#_1_1_13_1").val()==''))
{
alert('Please input an ARRIVAL TIME');
return false;
}
else if (!($("_1_1_17_1").is(':checked')) && ($("#_1_1_14_1").val()==''))
{
alert('Please input an DEPARTURE TIME');
return false;
}
else
{
return true;
}
}
<Fieldset>
<legend> POST </legend>
<ul>
<li>
<label class="required" for="_1_1_13_1">Arrival Time</LABEL>
<INPUT CLASS="valueEditable" TYPE="text" NAME="_1_1_13_1" TITLE="Arrival_Time" ID="_1_1_13_1" VALUE="[LL_FormTag_1_1_13_1 /]" SIZE="32" MAXLENGTH="32" ONCHANGE="markDirty();">
</LI>
<li>
<label class="required" for="_1_1_14_1">Departure Time</LABEL>
<INPUT CLASS="valueEditable" TYPE="text" NAME="_1_1_14_1" TITLE="Departure time" ID="_1_1_14_1" VALUE="[LL_FormTag_1_1_14_1 /]" SIZE="32" MAXLENGTH="32" ONCHANGE="markDirty();">
</LI>
<li>
<label for="_1_1_17_1"> Cancel</LABEL>
<INPUT TYPE="CHECKBOX" NAME="_1_1_17_1" value="1" ONCLICK="markDirty();">
</LI>
<li>
</ul>
</fieldset>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks