Re: Re: Open form in new window

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-Johnston@xxxxxxxxxxxxxxxxxxxxx> 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="fname"><br>
> > >>     >   Last name: <input type="text" name="lname"><br>
> > >>     >   <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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux