ThePsion5 Posted February 27, 2006 Share Posted February 27, 2006 Hi,I would like to figure out how to create a small popup window whenever a certain link is clicked. I think I have an idea of what I should do, but i'm not entirely positive it will work.Basicly, i have a search page that displays various results, one of which I would like to be a link that opens a new window. I know i can use the window.open function for this, but the problem is that I want to transfer information that I can use in a php script on the page. What's the best way to go about this? I was thinking about using GET to send the values (by dynamicly putting the GET values into the URL via javascript), but is this a good idea and how would I go about doing this (I havn't found any good tutorials on using GET values by entering them directly into the URL)?P.S. Security isn't an issue for the information i'm passing into the popup window. Link to comment Share on other sites More sharing options...
aspnetguy Posted February 27, 2006 Share Posted February 27, 2006 Passing ht einfo in GET is alright since you say security is not an issue. I use this method often.You can do it with javascript or PHP.You could catch the values of the form when the form is submitted with javascript and then open the new window. (this is probably easiest).Or you could submit the values to a php page which then builds the url then opens the new window by echoing some javascript.I would go with the first one. If you are worried about users that have javascript turned off you could use the target attribute of the form tag (it is depreciated in XHTML) http://www.htmlcodetutorial.com/forms/_FORM_TARGET.html. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 27, 2006 Share Posted February 27, 2006 use this in javascriptwindow.open('formname.php?id1=value1&id2=val2', 'popup', 'width=400,height=308,left=200,top=250'and GET the values in the popup window using PHP. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now