abdfahim Posted January 11, 2008 Share Posted January 11, 2008 I want that when I press submit button, this will check whether a text box is empty. If not, then it will open a pop up and load form action page there. I can do that individually, but the problem is when I want to join this two codes, the pop up is not shown. Instead a new page opens. Here is the code <script LANGUAGE="JavaScript"> function abc(){ if (document.myform.mytextbox.length==0){ alert("Error Message."); return false; }else{ return true; } } </script> <form name="myform" method="post" action="showdata_bsc.php" onSubmit="return abc();w=window.open('about:blank','mypage','width=800,height=600, scrollbars=yes, resizable=yes');w.focus();" target="mypage"> </form> Link to comment https://forums.phpfreaks.com/topic/85500-solved-problem-with-form-validation-and-windowopen/ Share on other sites More sharing options...
rajivgonsalves Posted January 11, 2008 Share Posted January 11, 2008 put the window.open() in your function Link to comment https://forums.phpfreaks.com/topic/85500-solved-problem-with-form-validation-and-windowopen/#findComment-436338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.