ajax call is not going when no error come from validate function
Hi In below function i m calling one validate function save()
if save() execute and give all values validated then ajax call go
other wise ajax call don't go . in below code save function is working
perfectly but when it gives no validation error ajax call is not going.
please help me out to recify this.
What does the save() function look like.
Are you sure that save() is returning TRUE - there is nothing in your code that indicates you are able to detect this.
For instance add this after line 29 - does the 'Validate Failed message appear?
if(document.forms.form2.pGroup.value == '0')
{
alert("Please select PGroup Code");
document.forms.form2.pGroup.focus();
return;
}
if(document.forms.form2.pType.value == '')
{
alert("Please select P Type");
document.forms.form2.pType.focus();
return;
}
if(document.forms.form2.pCode.value == '')
{
alert("Please select P Code");
document.forms.form2.pCode.focus();
return;
}
if(document.forms.form2.mYear.value == '')
{
alert("Please select M Year");
document.forms.form2.mYear.focus();
return;
}
if((pdate < pdate))
{
alert("P Date should be greater then C Date");
document.forms.form2.pdate.focus();
return;
}
if((bdate < pdate))
{
alert("B Date should be greater then P Date");
document.forms.form2.bdate.focus();
return;
}
if((bdate < pdate))
{
alert("B Date should be greater then P Date");
document.forms.form2.bdate.focus();
return;
}
Are you sure that save() is returning TRUE - there is nothing in your code that indicates you are able to detect this.
For instance add this after line 29 - does the 'Validate Failed message appear?
Open in new window
Have you tried defining your save() function like this for testing purpose
Open in new window
Does that work? If so we need to look at your save() code to see why it is returning false