Web Analytics Made Easy -
StatCounter Processing form in new window onclick - CodingForum


No announcement yet.

Processing form in new window onclick

  • Filter
  • Time
  • Show
Clear All
new posts

  • Processing form in new window onclick


    I am still having problems with this form. The revised code is below. The problems are:

    - the pop up window where the asp is processed opens but does not respect the size defined. The js that defines the pop up window is:

    function NewWindow(mypage, myname, w, h) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

    - when cursor is in text area and I press enter the onclick event is ignored and the asp page is loaded in the main window.

    Below is the script I am using for the form.

    <form method="post" name="frmEnquiry" action="asp/ezine.asp" onSubmit="return FormValidator(this)">
    <input type="text" name="email" size="20" value=" ... Your Email ..." onFocus="if(this.value==' ... Your Email ...')this.value='';" class="box3" onMouseOver="this.className='box3b'" onMouseOut="this.className='box3'" onClick="this.className='box3b'"><input type="submit" name="submit" OnClick="NewWindow('asp/ezine.asp','680','390','yes');return false;" value=" >> ISCRIVITI! " class="testo" style="color: #F4F4F4;border-color: #3163B7;border-width=2;background-color: #356CC8;width:120;height:17;font-family:Verdana;font-size:7pt;font-color:#000000">

    Can someone spot what how to solve the 2 problems above.


  • #2
    i made the NewWindow function that your using. the one you have is really old. you should go to my site and generate a new copy(url in sig).

    try this code. its the same method i use on my site to popup submited form data in a window.

    <form name="[B]yourform[/B]" action="yourpage.asp" target="[B]code[/B]">
    <input type="submit" value="submit" onclick="
    'center');document.forms.[B]yourform[/B].submit();return false;" />
    Last edited by eak; Jun 30, 2002, 01:12 PM.
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."


    • #3

      Just curious, but where did your original thread go with an ongoing discussion about this problem? IMHO it would have been better to continue the discussion in that thread as opposed to deleting it and starting a new thread on (essentially) the same problem.

      It would have been easier for everyone to follow along by seeing waht had been done thus far, you had quite a few replies there that might have contained some useful information to others trying to help you with this problem.

      Also, when a question is asked and a there are suggestions and / or solutions added to the thread, it is quite useful to leave the thread in place. This way, if someone comes along with a similar problem and searches the forum your thread may turn up in their search results and contain a sugesstion or 2 that might help them with their problem . Just my 2 cents worth $(:-|
      CodingForum Moderator
      "How did a fool and his money get together in the first place?"


      • #4
        Re: Processing form in new window onclick

        your function is this:

        function NewWindow(mypage, myname, w, h) {

        but you call it like this:


        maybe you want it like this:

        vBulletin Mods That Rock!


        • #5
          i found a better way to do it. this is the code from my site.
          <form name="NewWindowGenerator" action="newwindowcode.php" method="get" onsubmit="NewWindow('','generatedCode',650,500,'resizable,scrollbars','center');" target="generatedCode">
          other stuff  here
          eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."