Re: [PHP] Re: Open form in new window
On 3/4/2013 11:04 PM, tamouse mailing lists wrote: I would like to just take a step back and ponder what the user experience of this will be. Click a submit button, one of *many* as the OP says, and a new browser window opens? I don't think that is how most people experience the web these days. Technicalities of how one does this notwithstanding, I am urging the OP to consider their users. The OP's use of the word 'many' is subjective. Too you it might mean 5, to him it could very well mean 3. To me, either one is possible on many of my forms, since I try to provide the user with flexibility and function on each of my screens. Sometimes there are several things that a form could lead to, depending upon what the user needs to see or do. In this case, I can see the purpose for a separate window being opened. Sometimes (as a user myself) I have wished to have a screen of data appear to support my primary screen's use. It opens, I get some new input and I close it, going back to where I was. We obviously don't know the OP's task, but I can see usefulness and appreciate it. Just my $.02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
On Tue, Mar 5, 2013 at 8:37 AM, Jim Giner jim.gi...@albanyhandball.com wrote: On 3/4/2013 11:04 PM, tamouse mailing lists wrote: I would like to just take a step back and ponder what the user experience of this will be. Click a submit button, one of *many* as the OP says, and a new browser window opens? I don't think that is how most people experience the web these days. Technicalities of how one does this notwithstanding, I am urging the OP to consider their users. The OP's use of the word 'many' is subjective. Too you it might mean 5, to him it could very well mean 3. To me, either one is possible on many of my forms, since I try to provide the user with flexibility and function on each of my screens. Sometimes there are several things that a form could lead to, depending upon what the user needs to see or do. In this case, I can see the purpose for a separate window being opened. Sometimes (as a user myself) I have wished to have a screen of data appear to support my primary screen's use. It opens, I get some new input and I close it, going back to where I was. We obviously don't know the OP's task, but I can see usefulness and appreciate it. Just my $.02 Yes, it's all subjective, yes, what you like may not be what I like, and so on. Yet, UX people do agree on many things, and this is one of them. Popping a new browser window should be the user's choice. Not doing so leads to not only confusion, but also a11y problems. Which window gets focus? How does the user get back? These are real considerations when someone has to use a screen reader, or Voiceover. Navigating various windows can also be a problem for people with restricted mobility. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
You could echo HTML code e.g. form action=result.php method=post Number: input id=quantity type=text / *button type=button onclick=OpenWindow()Submit/button* /form or include it as one of your form attributes: *form action=demo_form.asp method=get target=_blank* First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form On 4 March 2013 07:16, Maciek Sokolewicz maciek.sokolew...@gmail.comwrote: On 4-3-2013 6:44, John Taylor-Johnston wrote: I have many different submit button. input value=Update type=submit input name=DPRmode value=Enter Data type=submit When php processes value=Enter Data, I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target= thingy. Can PHP do anything magic? No, it can't. PHP is a *serverside* language, while opening a new window is fully *clientside*. You could, after recieving the form submission, send back a redirect which opens in a new window; but far easier would be to use javascript which would open a new window on submission instead. PHP is definitly the wrong choice for things like opening browser windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- *Terry Ally* Twitter.com/terryally Facebook.com/terryally ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ To print or not to print this email is the environmentally-searching question! Which has the highest ecological cost? A sheet of paper or constantly switching on your computer and connecting to the Internet to read your email?
Re: [PHP] Re: Open form in new window
On 4 March 2013 09:32, Terry Ally (Gmail) terrya...@gmail.com wrote: You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
I was using an example and NOT intended to show ASP. On 4 March 2013 08:35, Maciek Sokolewicz maciek.sokolew...@gmail.comwrote: On 4 March 2013 09:32, Terry Ally (Gmail) terrya...@gmail.com wrote: You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. -- *Terry Ally* Twitter.com/terryally Facebook.com/terryally ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ To print or not to print this email is the environmentally-searching question! Which has the highest ecological cost? A sheet of paper or constantly switching on your computer and connecting to the Internet to read your email?
Re: [PHP] Re: Open form in new window
You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. I was using an example and NOT intended to show ASP. target=_blank will open a new window every time. That will defeat the purpose. I have many different submit buttons, for different purposes. Depending on the $_POST value of each submit button, I tell PHP to do different things, input value=Update type=submit input name=DPRmode value=Enter Data type=submit I want to open a different window when I press: input name=DPRmode value=Enter Data type=submit I guess the best I can hope for is to try input name=DPRmode value=Enter Data type=submit onclick=OpenWindow() button type=button onclick=OpenWindow()Submit/button will not submit the form contents. Thanks,
[PHP] Re: Open form in new window
On 04 Mar 2013 at 17:10, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: button type=button onclick=OpenWindow()Submit/button will not submit the form contents. Nothing to stop your OpenWindow() function doing a submit as in: button type=button onclick=OpenWindow(this.form)Submit/button function OpenWindow (formPtr) { // Some actions formPtr.submit (); } Personally I never submit forms. I use ajax to communicate with PHP scripts and do something with the data that is returned by the script. You can see a simple example at http://www.clothears.org.uk -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
On Mon, Mar 4, 2013 at 6:10 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit**/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. I was using an example and NOT intended to show ASP. target=_blank will open a new window every time. That will defeat the purpose. I have many different submit buttons, for different purposes. Depending on the $_POST value of each submit button, I tell PHP to do different things, I don't wanna interrupt this thread, but are you sure you want multiple submit buttons, especially more than two? There are probably better solutions for what you want, for example, radio button to select which action to take? - Matijn
Re: [PHP] Re: Open form in new window
On Mon, Mar 04, 2013 at 05:39:00PM +, Tim Streater wrote: On 04 Mar 2013 at 17:10, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: button type=button onclick=OpenWindow()Submit/button will not submit the form contents. Nothing to stop your OpenWindow() function doing a submit as in: button type=button onclick=OpenWindow(this.form)Submit/button function OpenWindow (formPtr) { // Some actions formPtr.submit (); } Personally I never submit forms. I use ajax to communicate with PHP scripts and do something with the data that is returned by the script. You can see a simple example at http://www.clothears.org.uk -- Cheers -- Tim I'm trying to figure out where the net gain in that is. The PHP file being called via AJAX is doing its processing on the server either way. So it appears the only difference is an asynchronous Javascript/AJAX call or a synchronous PHP call (on a standard PHP form submission). What am I missing? Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
On Mon, Mar 04, 2013 at 06:58:41PM +0100, Matijn Woudt wrote: On Mon, Mar 4, 2013 at 6:10 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit**/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. I was using an example and NOT intended to show ASP. target=_blank will open a new window every time. That will defeat the purpose. I have many different submit buttons, for different purposes. Depending on the $_POST value of each submit button, I tell PHP to do different things, I don't wanna interrupt this thread, but are you sure you want multiple submit buttons, especially more than two? There are probably better solutions for what you want, for example, radio button to select which action to take? - Matijn I have to agree with Matijn for this reason: If the user hits the [Enter] button at the end of their form data entry, it will trigger the *first* submit button on the page, which may or may not be what you want. Perhaps better to have the user indicate the action they wish via radio button (as Matijn suggested) and then a single submit button. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
On Mon, 2013-03-04 at 15:22 -0500, Paul M Foster wrote: On Mon, Mar 04, 2013 at 06:58:41PM +0100, Matijn Woudt wrote: On Mon, Mar 4, 2013 at 6:10 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit**/button /form or include it as one of your form attributes: form action=demo_form.asp method=get target=_blank First name: input type=text name=fnamebr Last name: input type=text name=lnamebr input type=submit value=Submit /form Again, pure HTML, and no PHP involved. Specifically, the (asp??) page called in the form action handler will never even be aware of the fact that the page was opened in a new window, or at least was supposed to. I was using an example and NOT intended to show ASP. target=_blank will open a new window every time. That will defeat the purpose. I have many different submit buttons, for different purposes. Depending on the $_POST value of each submit button, I tell PHP to do different things, I don't wanna interrupt this thread, but are you sure you want multiple submit buttons, especially more than two? There are probably better solutions for what you want, for example, radio button to select which action to take? - Matijn I have to agree with Matijn for this reason: If the user hits the [Enter] button at the end of their form data entry, it will trigger the *first* submit button on the page, which may or may not be what you want. Perhaps better to have the user indicate the action they wish via radio button (as Matijn suggested) and then a single submit button. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com I don't know if that would hold true for forms that contain multiple submit buttons. There are plenty of good reasons though for multiple submit buttons in a form, such as a shopping cart where each button is tied to a product and allows it to be removed. Thanks, Ash http://www.ashleysheridan.co.uk
[PHP] Re: Open form in new window
On 04 Mar 2013 at 20:17, Paul M Foster pa...@quillandmouse.com wrote: On Mon, Mar 04, 2013 at 05:39:00PM +, Tim Streater wrote: Personally I never submit forms. I use ajax to communicate with PHP scripts and do something with the data that is returned by the script. You can see a simple example at http://www.clothears.org.uk I'm trying to figure out where the net gain in that is. The PHP file being called via AJAX is doing its processing on the server either way. So it appears the only difference is an asynchronous Javascript/AJAX call or a synchronous PHP call (on a standard PHP form submission). What am I missing? ISTM it's better for the user if, rather than reloading a whole page, you can get some bits of data from the server and use them to just alter the parts of the page that need updating. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Open form in new window
On 3/4/2013 12:44 AM, John Taylor-Johnston wrote: I have many different submit button. input value=Update type=submit input name=DPRmode value=Enter Data type=submit When php processes value=Enter Data, I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target= thingy. Can PHP do anything magic? Just put the DPRmode button in a separate form where that form's target attribute specifies another window name. Check your html reference for reserved names you can use or just make one up. If you need some of the input values that duplicated in this new form, use an onclick js function to populate some hidden html fields contained within the form from the original inputs outside the form. A bit of work, but very easy to do. OR - you could use that same js function to alter the target parm of the single form that you have. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Open form in new window
I would like to just take a step back and ponder what the user experience of this will be. Click a submit button, one of *many* as the OP says, and a new browser window opens? I don't think that is how most people experience the web these days. Technicalities of how one does this notwithstanding, I am urging the OP to consider their users. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Open form in new window
On 4-3-2013 6:44, John Taylor-Johnston wrote: I have many different submit button. input value=Update type=submit input name=DPRmode value=Enter Data type=submit When php processes value=Enter Data, I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target= thingy. Can PHP do anything magic? No, it can't. PHP is a *serverside* language, while opening a new window is fully *clientside*. You could, after recieving the form submission, send back a redirect which opens in a new window; but far easier would be to use javascript which would open a new window on submission instead. PHP is definitly the wrong choice for things like opening browser windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php