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 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2004
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Html Form in a pop up window javascript

    I have created a form in a pop up window. Once the form is submitted, I would like the form to send the information to my email address at michel.bayard@videotron.ca and then go to a customized thank you page within the same pop up (thankyou.html). In the form action, I have it as my e-mail address, which works fine, but I cannot have the thank you page appear afterwards. If i change the action to the thank you page and change the method to get then the page will appear, but then it doesn't send the e-mail to my address. I am really not a coding person at all and don't know too much. Is there a script I can integrate that upon submission of form that it verifies the required fields and if all is correct sends it to my email address and then goes to the thank you page?

    Any contribution would be greatly appreciated.

    Thank you kindly in advance.

    --

    This part in in the "head" aspect of the html

    <SCRIPT LANGUAGE="JavaScript">

    image1 = new Image();
    image1.src = "../img/closewindow_over.gif";

    function checkrequired(which) {
    var pass=true;
    if (document.images) {
    for (i=0;i<which.length;i++) {
    var tempobj=which.elements[i];
    if (tempobj.name.substring(0,8)=="required") {
    if (((tempobj.type=="text"||tempobj.type=="textarea")&&
    tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
    tempobj.selectedIndex==0)) {
    pass=false;
    break;
    }
    }
    }
    }

    if (!pass) {
    shortFieldName=tempobj.name.substring(8,30).toUpperCase();
    window.open('../html/form_email_missing.html', 'newwin','width=256,height=110, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, left=0,top=100,screenX=0,screenY=100');
    return false;
    }
    else
    return true;
    }

    </script>

    In the form aspect I have this code:

    form action="mailto:michel.bayard@videotron.ca" method="post" enctype="text/plain"

  • #2
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the 'thankYou.html' could be opened with 'document.location = thankyou.html'
    <JPM />

  • #3
    Regular Coder
    Join Date
    May 2004
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your reply!!!!

    But where do I put this code? Is it in the script header, or onsubmit? I don't know where to put it!!!!

    Thanks for your help!


  •  

    Posting Permissions

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