dear friends am having two files file 1 file2... in file1.html havinf form and also i written on validation function file1.html function x() { if(document.frm.txt_name.value==0){ alert("enter somthing"); return false } else if( here i want to call the function ----> y){ return false; } else return true; } file2.js contain ajax function how i call the function y(){ ajax operation } thanks in advance
file1.html <script src="file2.js"></script> <script type="text/javascript"> function x() { if(document.frm.txt_name.value==0){ alert("enter somthing"); return false } else{ y (); return false; }</script> This is what you wanted?