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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.