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="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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to