Jump to content

[SOLVED] Problem with form validation and window.open


abdfahim

Recommended Posts

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.