phppup Posted March 10, 2012 Share Posted March 10, 2012 I have a page that will sort my DB table by name and telephone number. And it has a button. I want visitors to be able to input a last name, and have the telephone number provided in a SEPERATE and NEW window after they click the button. Any suggestions for best procedure? My two initial concepts are: 1- Make this a form, with the "action" leading to a file like SELECT *FROM myTable WHERE last name="$inputname" and have then use Javascript ONSUBMIT to open a NEW window. (not sure it will succeed as I desire) 2- Make this a simple BUTTON with Javascript pointing everything to the file to process the quiery. PS: I've heard IE doesn't always handle "_BLANK" properly, and I'm unaware of a PHP method. Haven't thought it through entirely, so I'm looking for pointers and advise. Quote Link to comment https://forums.phpfreaks.com/topic/258663-opening-a-new-window/ Share on other sites More sharing options...
gizmola Posted March 10, 2012 Share Posted March 10, 2012 In general, popups and popupblockers have made this type of approach difficult for developers who are not in a controlled environment (ie. an intranet). The alternative is to use javascript and simulate modal dialogs which can be done very easily using jquery and related code. Google jquery dialog and look at articles like this one: http://www.jquery4u.com/windows/14-jquery-modal-dialog-boxes/ Quote Link to comment https://forums.phpfreaks.com/topic/258663-opening-a-new-window/#findComment-1325971 Share on other sites More sharing options...
phppup Posted March 10, 2012 Author Share Posted March 10, 2012 This WILL be used in a CONTROLLED environment. So what's the easiest/most effective approach (as I'm not acquainted w/JQuery and AJAX)? Quote Link to comment https://forums.phpfreaks.com/topic/258663-opening-a-new-window/#findComment-1325977 Share on other sites More sharing options...
gizmola Posted March 10, 2012 Share Posted March 10, 2012 Most of the popup blocking rules don't apply to intranets so you can probably go that way. Jquery is a cross browser javascript framework. It is by far the most heavily used framework of its kind, and I can't advise strongly enough that you will benefit from learning it and employing it in your project -- intranet or not. At the end of the day, having multiple browser windows open is problematic and just not the general trend. This is why all the browsers implemented tabbed browsing. If what you are after is this: Main Results Table -> search dialog to refine results -> intermediary result to choose refinement criteria -> Update Main results That requires coordination and passing of results, as well as inter window communication. Having 1 or 2 popups is bound to confuse someone as those windows stay open and can get backgrounded or hidden behind another window very easily. Quote Link to comment https://forums.phpfreaks.com/topic/258663-opening-a-new-window/#findComment-1325984 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.