the ajax function emailval calls a jsp page known as regajax which then checks required conditions and prints apt message.
The problem is how will my form know that the entries are wrong since my ajax call simply prints the apt message.Is it possible to return some boolean value from an ajax call which i could pass on to the form.If yes then how do i pass the value returned by ajax method to the form so that if entries are wrong then the form should not be submitted.
If no then what should be my approach.
Manas Saxena wrote: since my ajax call simply prints the apt message.
That's your problem. You're just returning semantic-less text and shoving it into the DOM. Not a good approach,