wwfc_barmy_army Posted October 5, 2006 Share Posted October 5, 2006 Hi,I've got this code to vote for a site and that loads ratesite.php: <td colspan="2"><form action="ratesite.php?id=<? print "$qry[id]" ?>" method="post" name="rating" id="rating">Rate this site:<br><select name="rating"><option value="5" selected>5</option><option value="4">4</option><option value="3">3</option><option value="2">2</option><option value="1">1</option></select><input name="<? echo $_GET[id] ?>" type="hidden" id="<? echo $_GET[id] ?>" value="<? echo $_GET[id] ?>"><input name="cmd" type="hidden" id="cmd" value="do _rating"><input type="submit" name="Submit" value="Go!"></form></td>Although i am wondering if there is a way that i can make it so it opens a new windows and a windows that is roughly 200px by 200px in size, just so it's a little window. I dunno how to do this with it being submitted as a form. Any ideas/advice?Thanks.Peter. Quote Link to comment https://forums.phpfreaks.com/topic/23092-open-new-window-from-form/ Share on other sites More sharing options...
akitchin Posted October 5, 2006 Share Posted October 5, 2006 the form element has a target attribute, just like links:[code]<form action="ratesite.php?id=<? print "$qry[id]" ?>" method="post" name="rating" id="rating" target="_blank">[/code]that will open the form in a new window without any window controls. in order to specify the height/width (and the other params), you may need some javascript fudgery to create the new window, change the target of the form to the new window's name, and then submit the form when the submit button is hit. Quote Link to comment https://forums.phpfreaks.com/topic/23092-open-new-window-from-form/#findComment-104419 Share on other sites More sharing options...
wwfc_barmy_army Posted October 5, 2006 Author Share Posted October 5, 2006 Thanks! :) Quote Link to comment https://forums.phpfreaks.com/topic/23092-open-new-window-from-form/#findComment-104430 Share on other sites More sharing options...
akitchin Posted October 5, 2006 Share Posted October 5, 2006 glad to help, come on back if you have problems doing the form submission javascript (opening window, changing target, and submitting). Quote Link to comment https://forums.phpfreaks.com/topic/23092-open-new-window-from-form/#findComment-104435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.