Results 1 to 7 of 7

Thread: how to make the pop up window work after clicking submit button?

  1. #1
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to make the dhtml pop up window not to appear when enter the page?

    Hi there, i need someone to help me and guide me on how to
    modify the code below. I am making a contact form whereby
    after the user click the submit button, a popup nice window will
    show and notify the user that his/her enquiry has been received.

    Now the problem is, i am using a dhtml popup window script
    that will display the popup when you open up this contact form.
    But now it will display even before the user submit the form.
    Instead I want it to appear only once after user click submit button.
    Can somone one here guide me how to do it and look through my
    script coding please?

    Here's the link to my form < contact form >
    Last edited by blankibaby; 07-07-2005 at 07:21 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I can probably get back to you later with more details, for one thing, don't launch it onload.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi~!

    is this the section where should i change it? [highlighted in red below.]
    I remove the onload and it works but it doesnt work for after clicking submit
    button. The dhtml window won't appear.


    function initfunction(){
    setTimeout("displayfadeinbox()", 100)
    }

    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset)
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }

    return returnvalue;
    }
    if (displaymode=="oncepersession" && get_cookie("fadedin")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
    if (window.addEventListener)
    window.addEventListener("load", initfunction, false)
    else if (window.attachEvent)
    window.attachEvent("onload", initfunction)
    }
    </script>

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not sure how this will work live but, locally it did the trick. Change:
    Code:
    if (displaymode=="oncepersession" && get_cookie("fadedin")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
    to:
    Code:
    if (((displaymode=="oncepersession" && get_cookie("fadedin")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0))&&(location.href.indexOf('&')!==-1)){
    and get rid of this:
    Code:
     onsubmit="openpopup()"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi john, thank you ~!(^ ^)
    however, i still have one more problem, after changing the code, the pop up
    dhtml window won't display after clicking submit button.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I just retested using your online example and applying my modifications as I laid them out. It works here. I also tested the live page, and from its behavior, it should work live as well. Were you applying my modifications to a page that is different than the live one you supplied a link to in one of your previous posts? One final thing the modifications in my previous post are the only modifications needed, forget about what I said before that, when I was in a big hurry.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi john~!

    i went through my coding and i realized i didn't remove the
    method="post" under the body tag (>_<)
    which i added in earlier on later today after uploaded my question(>_<)~~
    that's why is not working and i have remove it and it works now(^ ^)
    *yay thank you~!*

    errm... however, provided if i don't want to remove the method="post" is there another way to have this dhtml
    window pop up after clicking submit button?

    And lastly, which part of the scripting that allow me to reposition
    the dhtml pop up window
    as i would like it to be else where which is
    not too near the contact form's select button as i just realized that
    the layer will be overlap/hidden at the back ....

    thanks again very much!
    Last edited by blankibaby; 07-08-2005 at 08:37 PM.

Bookmarks

Posting Permissions

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