Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Processing form in new window onclick

    Hi,

    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">
    </form>

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

    DHTMLHELP

  • #2
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    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.

    Code:
    <form name="yourform" action="yourpage.asp" target="code">
    
    <input type="submit" value="submit" onclick="
    NewWindow('','code',650,500,'resizable,scrollbars',
    'center');document.forms.yourform.submit();return false;" />
    </form>
    Last edited by eak; 06-30-2002 at 06: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
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    573
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dhtmlhelp,

    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 $(:-|
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts

    Re: Processing form in new window onclick

    your function is this:

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


    but you call it like this:

    OnClick="NewWindow('asp/ezine.asp','680','390','yes');


    maybe you want it like this:

    OnClick="NewWindow('asp/ezine.asp','yes','680','390');
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    i found a better way to do it. this is the code from my site.
    Code:
    <form name="NewWindowGenerator" action="newwindowcode.php" method="get" onsubmit="NewWindow('','generatedCode',650,500,'resizable,scrollbars','center');" target="generatedCode">
    
    other stuff  here
    
    </form>
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •