Alternative form submission

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

    Alternative form submission

    Is there a way to get an HTML form to be submitted (via POST) by using
    an image button instead of a submit button for instance?

  • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

    #2
    Re: Alternative form submission

    crater wrote:
    Is there a way to get an HTML form to be submitted (via POST) by using
    an image button instead of a submit button for instance?
    <form action='foobar. php' method='post'>
    <input type='image' src='foobar.png ' />
    </form>

    Just check your (X)HTML reference for more details about <input
    type='image'/>.
    --
    ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-


    Proudly running Debian Linux with 2.6.17-1-686 kernel, KDE3.5.3, and PHP
    5.2.0-8 generating this signature.
    Uptime: 17:15:18 up 16:04, 1 user, load average: 0.69, 2.05, 1.57

    Comment

    • crater

      #3
      Re: Alternative form submission

      Just check your (X)HTML reference for more details about <input
      type='image'/>.
      I didn't think it would be as simple as that!
      I take it therefore that any button in the form would achieve the same
      end?

      Comment

      • Michael Fesser

        #4
        Re: Alternative form submission

        ..oO(Iván Sánchez Ortega)
        >crater wrote:
        >
        >Is there a way to get an HTML form to be submitted (via POST) by using
        >an image button instead of a submit button for instance?
        >
        ><form action='foobar. php' method='post'>
        ><input type='image' src='foobar.png ' />
        ></form>
        <input type='image' src='foobar.png ' alt='submit' />

        Micha

        Comment

        • andyhowlett@googlemail.com

          #5
          Re: Alternative form submission

          On Feb 10, 5:00 pm, Michael Fesser <neti...@gmx.de wrote:
          .oO(Iván Sánchez Ortega)
          >
          crater wrote:
          >
          Is there a way to get an HTML form to be submitted (via POST) by using
          an image button instead of a submit button for instance?
          >
          <form action='foobar. php' method='post'>
          <input type='image' src='foobar.png ' />
          </form>
          >
          <input type='image' src='foobar.png ' alt='submit' />
          >
          Micha
          Alternatively I think this might work (and for text etc. too):
          <form action="file" method="post">
          <input type="text" name="blah" />
          </form>
          <span onclick="javasc ript:document.f orms[0].submit();">ima ge, text or
          whatever</span>

          Comment

          • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

            #6
            Re: Alternative form submission

            andyhowlett@goo glemail.com wrote:
            Alternatively I think this might work (and for text etc. too):
            <form action="file" method="post">
            <input type="text" name="blah" />
            </form>
            <span onclick="javasc ript:document.f orms[0].submit();">ima ge, text or
            whatever</span>
            Don't *ever* suppose that the user has javascript enabled. Always provide an
            alternative, non-javascript method for submitting the form, such as:

            <form action="file" method="post">
            <input type="text" name="blah" />

            <noscript><inpu t type='submit' /></noscript>

            </form>
            <span onclick="javasc ript:document.f orms[0].submit();">ima ge, text or
            whatever</span>


            --
            ----------------------------------
            Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

            El placer es el bien primero. Es el comienzo de toda preferencia y de
            toda aversión. Es la ausencia del dolor en el cuerpo y la inquietud en
            el alma.
            -- Epicuro de Samos. (341-270 a.C.) Filósofo griego.

            Comment

            Working...