SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2000
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have a form like this on a page called emailform.htm:

    <form method="post" onSubmit=NewWindow()>
    <H3>From: <input type="text" name="from"></H3>
    <H3>Message: <input type="text" name="body"></H3>
    <input type="submit" value="Send the Message">
    </form>

    when submitted, it calls this function:

    function NewWindow(){
    window.open('sendmail.php', 'newWin', 'scrollbars=no,
    toolbar=no, width=200, height=200');
    }

    two problems:

    1. the form values are not getting passed over to sendmail.php.
    2. after the popup window pops up and loads sendmail.php, the original page, emailform.htm, changes to an error page.

    so, what do i need to do to get the form values to be passed, and how do i keep the original page either from changing at all, or, if thats not possible, get it to simply reload itself.

    thanks.

  2. #2
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A lot of helpful information on working with forms and values in different windows can be found at http://developer.irt.org/script/form.htm#10.3

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Humm!

    That's a tough deal. Whats happening is that you are losing your post because JavaScript is opening sendmail.php from that function you have. But the form is still trying to post somewhere. So you are getting that 500 on the form page. You could try posting to a php page that then opens the pop up with your variables on the query string. Then use a redirect to reload the form page.

  4. #4
    SitePoint Member Memphis's Avatar
    Join Date
    Apr 2001
    Location
    memphis
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    keep it php

    my entire site is php and does some very similar things -- http://www.memphisdate.com/

    see how this is handled and i can send you some code samples


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
  •