RETURN shall not submit a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christoph Weber

    RETURN shall not submit a form

    Hello,
    I have the problem that I want to submit a form only if the submit button is
    clicked with the mouse.
    The form should not be submitted if the user hits the RETURN key.

    Any suggenstions?

    Thanks
    Christoph


  • Uzi Klein

    #2
    Re: RETURN shall not submit a form

    Thats more of HTML question, but im in a good mood ;)
    just replace the submit button with <input type='button' onclick='this.f orm.submit()'>

    hope it helps.

    U.


    "Christoph Weber" <christoph.webe r@im-achental.de> wrote in message news:2g8kjmF5li paU1@uni-berlin.de...[color=blue]
    > Hello,
    > I have the problem that I want to submit a form only if the submit button is
    > clicked with the mouse.
    > The form should not be submitted if the user hits the RETURN key.
    >
    > Any suggenstions?
    >
    > Thanks
    > Christoph
    >
    >[/color]


    Comment

    • Pedro Graca

      #3
      Re: RETURN shall not submit a form

      Uzi Klein wrote:[color=blue]
      > "Christoph Weber" <christoph.webe r@im-achental.de> wrote in message news:2g8kjmF5li paU1@uni-berlin.de...[color=green]
      >> Hello,
      >> I have the problem that I want to submit a form only if the submit button is
      >> clicked with the mouse.
      >> The form should not be submitted if the user hits the RETURN key.
      >>
      >> Any suggenstions?
      >>
      >> Thanks
      >> Christoph
      >>
      >>[/color]
      > Thats more of HTML question, but im in a good mood ;)
      > just replace the submit button with <input type='button' onclick='this.f orm.submit()'>
      >
      > hope it helps.[/color]

      Don't forget to transform gracefully [1]:

      add
      <noscript><inpu t type="submit"/></noscript>
      to your HTML.


      [1] http://www.w3.org/TR/WAI-WEBCONTENT/...orm-gracefully

      --
      USENET would be a better place if everybody read: : mail address :
      http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
      http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
      http://www.expita.com/nomime.html : to 10K bytes :

      Comment

      • John Dunlop

        #4
        Re: RETURN shall not submit a form

        Christoph Weber wrote:
        [color=blue]
        > I have the problem that I want to submit a form only if the submit button is
        > clicked with the mouse.
        > The form should not be submitted if the user hits the RETURN key.
        >
        > Any suggenstions?[/color]

        Click the submit button with your mouse and don't hit the RETURN key.

        --
        Jock

        Comment

        • Michael Selent

          #5
          Re: RETURN shall not submit a form

          Christoph Weber schrieb im Artikel <2g8kjmF5lipaU1 @uni-berlin.de>:
          [color=blue]
          > clicked with the mouse.
          > The form should not be submitted if the user hits the RETURN key.[/color]

          You could give the submit button a name and check in your form if the
          variable $_POST[buttonname] (resp. $_[GET]....) is empty respectively set.
          e.g.:
          <form name="somewhat" action="my_php_ form.php" method="post">
          [...]
          <input type="submit" name="buttonnam e" value="click me">
          </form>


          in your evaluation form you may try using:

          if (empty($_POST[buttonname]))
          {
          echo "please click button for submit";
          exit;
          }

          --
          PGP key available

          Comment

          Working...