posted 10 years ago
Hi,
Im facing issue in validating my form through javascript code. When my javascript function viewdetails() gets called then it is printing the alert hiding/showing... which is correct as this alert is coming first in javascript logic and then it calls 2nd alert Case level lock check... inside AJAX beforeSend block which is also correct. But immediately after this, why it is calling the alert out of ajax call which is writting out of AJAX logic?
My AJAX logic is to first validate the form based on return value of JSON object inside AJAX success:function and then decide whether to block form submission(by return false;) or proceed with form submission.
Problem is that the control is going to 3rd alert out of ajax call without waiting for AJAX response and this form is keep submitting.
Javascript function:-
Following is how Im calling this function:-
<a href="javascript: viewdetails('<%=rNo%>','<securednested:write property="feedbackNumber" />','<securednested:write property="commentNumber" />','<securednested:write property="commentStatusCode" />','<securednested:write property="feedbackStatusCode"/>','<securednested:write property="jobTypeDescription"/>', '<securednested:write property="workFlowProssCode"/>'); return false;"><img id="processingId" src="images/icms_process.png" title="Processing" width="50" height="50" border="0"/></a>
Please help me in suggesting some useful tips as I have tried a lot with different combinations of calling this javascript function:-
<input onclick="return viewdetails('<%=rNo%>','<securednested:write property="feedbackNumber" />','<securednested:write property="commentNumber" />','<securednested:write property="commentStatusCode" />','<securednested:write property="feedbackStatusCode"/>','<securednested:write property="jobTypeDescription"/>', '<securednested:write property="workFlowProssCode"/>');" id="processingId" type="image" src="images/icms_process.png" alt="Processing" width="50" height="50">
and
<input onclick="javascript: viewdetails('<%=rNo%>','<securednested:write property="feedbackNumber" />','<securednested:write property="commentNumber" />','<securednested:write property="commentStatusCode" />','<securednested:write property="feedbackStatusCode"/>','<securednested:write property="jobTypeDescription"/>', '<securednested:write property="workFlowProssCode"/>'); return false;" id="processingId" type="image" src="images/icms_process.png" alt="Processing" width="50" height="50">