SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Apr 5, 2001, 08:56 #1
- 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.
-
Apr 5, 2001, 09:41 #2
- 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
-
Apr 6, 2001, 10:55 #3
- 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.
-
Apr 6, 2001, 11:57 #4
- 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