form with to submits, which one to default to? - PHP

This is a discussion on form with to submits, which one to default to? - PHP ; Hi Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the ...

+ Reply to Thread
Results 1 to 5 of 5

form with to submits, which one to default to?

  1. Default form with to submits, which one to default to?

    Hi

    Say, I have a form.

    Both cancel and save (in that order) are submits, then in the code I
    check which button was pressed.
    The point is that I want the save button (2nd) to be default, not the
    cancel.

    Is there a way (in js?) to "focus" the other button?

    One other way to be some simple js, which submits the page anyway...

    WBR
    Sonnich

  2. Default Re: form with to submits, which one to default to?

    jodleren wrote:
    > Hi
    >
    > Say, I have a form.
    >
    > Both cancel and save (in that order) are submits, then in the code I
    > check which button was pressed.
    > The point is that I want the save button (2nd) to be default, not the
    > cancel.
    >
    > Is there a way (in js?) to "focus" the other button?
    >
    > One other way to be some simple js, which submits the page anyway...
    >
    > WBR
    > Sonnich
    >


    Try a JS newsgroup. This one is for PHP - which can't do it.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attglobal.net
    ==================


  3. Default Re: form with to submits, which one to default to?

    ..oO(jodleren)

    >Say, I have a form.
    >
    >Both cancel and save (in that order) are submits, then in the code I
    >check which button was pressed.
    >The point is that I want the save button (2nd) to be default, not the
    >cancel.
    >
    >Is there a way (in js?) to "focus" the other button?


    No. But why do you need a cancel button at all? Usually it's as useless
    as a reset button.

    >One other way to be some simple js, which submits the page anyway...


    Even worse and unreliable.

    Micha

  4. Default Re: form with to submits, which one to default to?

    > Both cancel and save (in that order) are submits, then in the code I
    > check which button was pressed.
    > The point is that I want the save button (2nd) to be default, not the
    > cancel.
    >
    > Is there a way (in js?) to "focus" the other button?



    As a dirty hack, you could make the second button come first in the HTML
    and flip it over with a stylesheet.

    Good luck

  5. Default Re: form with to submits, which one to default to?

    On Dec 4, 10:12 am, Dikkie Dik <dik...@nospam.org> wrote:
    > > Both cancel and save (in that order) are submits, then in the code I
    > > check which button was pressed.
    > > The point is that I want the save button (2nd) to be default, not the
    > > cancel.

    >
    > > Is there a way (in js?) to "focus" the other button?

    >
    > As a dirty hack, you could make the second button come first in the HTML
    > and flip it over with a stylesheet.
    >
    > Good luck


    HTML supports tabindex="#".
    That ought to do.

+ Reply to Thread

Similar Threads

  1. Default form of DSNs?
    By Application Development in forum SendMail
    Replies: 2
    Last Post: 07-09-2007, 04:44 AM
  2. incomplete form submits when "return" key hit using formmail.pl
    By Application Development in forum Adobe Tools
    Replies: 6
    Last Post: 08-22-2006, 11:03 AM
  3. form submits multiple times in IE only at customer site
    By Application Development in forum Java
    Replies: 6
    Last Post: 03-20-2006, 09:43 AM
  4. Changing the default appointment form
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 12-21-2004, 04:23 AM
  5. Help needed with form submits and Perl handling
    By Application Development in forum Perl
    Replies: 1
    Last Post: 07-21-2003, 12:00 AM