Re: PHP script and new window.

From: Date: Tue, 24 Apr 2001 00:10:35 +0000
Subject: Re: PHP script and new window.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49963@lists.php.net to get a copy of this message
First of all, I believe since you are using javascript on your button you shouldn't use type="submit". Change it to type="button", which means it will have no effect for browsers that don't have javascript enabled when clicked. That could be an error, for one. But then again, it might not. It might cause it to be submitted to one page and opened on another, which very well may be what you want to happen. However it might be that the window is being opened first then the data is submitted second, thus the error that's being caused. To fix it just add the window.open function in the <head> area of your document, so that as soon as the page is viewed the window pops up. Annoying if the user hits refresh, but what you could do is use a Meta-Refresh to take them from the page that pops up the window to the page that user should be normally seing. Next, how is it that you are getting the data and what data are you getting? For instance, are you using the id you are submitting to the other page to see how that user voted? Or are you just tracking who's viewing that page? Further, does what you are displaying depend on what id is being submitted? Lastly, view source on your HTML page and ensure all the fields are getting filled out like you expect them to. It happens all the time that by using View Source I find what my problem was. -- Plutarck Should be working on something... ...but forgot what it was. ""Angerer, Chad"" <cangerer@ibsys.com> wrote in message news:9E35C54B0C7AD411B5C1009027DE539940B5EF@MSPMX01... > I have searched high and low for thos but with no luck. Hopefully someone > will give me some good pointers. > > I have a poll on a page that I am building which uses php. I would like to > have a new window open when the submit and view results links are selected. > I am using an onClick and the view results window works fine. It is the > submit button I am having trouble with. The new window won't populate with > any info. > > Here is the form that I have on my page > > <form method="post" action="vote.php"> > <div class="pollTitle"><? echo $question; ?></div> > <div class="pollResponse"> > <input type="Radio" name="response" value="1"><? echo > $response1; > ?><br> > <input type="Radio" name="response" value="2"><? echo > $response2; > ?><br> > <input type="Radio" name="response" value="3"><? echo > $response3; > ?><br></div> > <input type="hidden" name="id" value="<? echo $id; > ?>"> > <font size=-2><a href="#" > onClick="window.open('archive.php?id=<? > echo $id; > ?>','archive','toolbar=no,status=no.location=no,menubar=no,top=50,left=50,he > ight=250,width=200,scrollbars=no'); return false;">view > results</a></font><br><br> > <input type="submit" name="submit" value="Vote" > onClick="window.open('http://www.askedagain.com/vote.php','vote','toolbar=no > ,status=no.location=no,menubar=no,top=50,left=50,height=250,width=200,scroll > bars=no'); return false;"> > </form> > > The vote script works fine as if I just have it load in the current browser > window. Is there something that I am missing? Any help and/or ideas are > much appreciated. > > Thanks again. > > CAA > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#49963) next »