jrod356a Posted March 15, 2009 Share Posted March 15, 2009 Hi all,I'm a PHP "Newbie" and am having trouble figuring out how to do the following:I have a page with a form that contains radio buttons for each option available to the user to submit via a submit button. The "form action" for the form is set to call a php script file (rpt_rdo_sel.php) when the submit button is clicked. I am trying to have a popup window opened when the user selects one of a particular set of radio buttons (any of the last 3 radio buttons on the form). The popup window is supposed to open and load an existing page located in my site's "dev/" directory. Through my research on the web, I found sample code to do this as follows:I made these entries in the rpt_rdo_sel.php file that is called when the submit button is clicked:Add the javascript code before the "<?php" or after the "?>" tags (I chose to put it before):<script type="javascript">function openRequestedPopup(){ window.open('http://www.usedcarinteriors.com/dev/finadminlogin.php', 'FinanceAdminReportsLogin', 'width=545,height=326,resizable=yes,scrollbars=yes,status=yes');}</script>Then add the following code within the PHP tags:echo "<script type='javascript'>openRequestedPopup();</script>";I then tested this by opening the form page in a browser window, I clicked one of the radio buttons that I designated for this function and clicked the submit button. I then got a blank page and the popup window I expected did not open. No errors were displayed on the resulting page however, I have FirePHP (a debugger tool) installed (I performed the test with FireFox) and I checked the output under the "Net" tab. The "Post" values were correctly passed but the "Response" values reported show the javascript code and the php "echo" code I added in the .php file. Now I'm not sure if my assumption is correct but I'm thinking that code may have been treated as comments text instead of program instructions and this is why all I'm getting is a blank page result?Can anyone help me to get this working like I want it to? Link to comment Share on other sites More sharing options...
Ingolme Posted March 16, 2009 Share Posted March 16, 2009 Try <script type="text/javascript"> Link to comment Share on other sites More sharing options...
jrod356a Posted March 17, 2009 Author Share Posted March 17, 2009 Try <script type="text/javascript"> Thanks so much for your help! This was the issue. It's amazing how something that seems so trivial could screw things up so bad! Thanks again for your help! Link to comment Share on other sites More sharing options...
Ingolme Posted March 17, 2009 Share Posted March 17, 2009 Once you've been a few years coding these things become easy to spot. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.