Loading ...
Sorry, an error occurred while loading the content.

Submitting images

Expand Messages
  • rola_51
    I use an image to bring a popup window with a calendar. I found that an image defined as $frmProy- AddInput(array( TYPE = image , ID = image_CalFin ,
    Message 1 of 3 , Sep 14, 2004
    • 0 Attachment
      I use an image to bring a popup window with a calendar. I found that
      an image defined as
      $frmProy->AddInput(array(
      "TYPE"=>"image",
      "ID"=>"image_CalFin",
      "SRC"=>"../js/img/CAL.GIF",
      "ALT"=>"Calendario-fin",
      "ONCLICK"=>"calFin.popup()"
      )
      ));
      triggers a form SUBMIT, which is not the intended behviour. If I
      replace the image with a button, everything works fine. Is there a
      way to inhibit the form submission via image clicks?

      Thanks for any suggestion...
    • Manuel Lemos
      Hello, ... Just define the ONCLICK attribute like this: ONCLICK = calFin.popup(); return false; -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP
      Message 2 of 3 , Sep 14, 2004
      • 0 Attachment
        Hello,

        On 09/14/2004 06:15 PM, rola_51 wrote:
        >
        > I use an image to bring a popup window with a calendar. I found that
        > an image defined as
        > $frmProy->AddInput(array(
        > "TYPE"=>"image",
        > "ID"=>"image_CalFin",
        > "SRC"=>"../js/img/CAL.GIF",
        > "ALT"=>"Calendario-fin",
        > "ONCLICK"=>"calFin.popup()"
        > )
        > ));
        > triggers a form SUBMIT, which is not the intended behviour. If I
        > replace the image with a button, everything works fine. Is there a
        > way to inhibit the form submission via image clicks?
        >
        > Thanks for any suggestion...

        Just define the ONCLICK attribute like this:

        "ONCLICK"=>"calFin.popup(); return false;"


        --

        Regards,
        Manuel Lemos

        PHP Classes - Free ready to use OOP components written in PHP
        http://www.phpclasses.org/

        PHP Reviews - Reviews of PHP books and other products
        http://www.phpclasses.org/reviews/

        Metastorage - Data object relational mapping layer generator
        http://www.meta-language.net/metastorage.html
      • rola_51
        ... that ... a ... The problem with this solution is that, if I have two or more such images on my form, or click twice on the image, I get the re- submission
        Message 3 of 3 , Sep 15, 2004
        • 0 Attachment
          --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
          > Hello,
          >
          > On 09/14/2004 06:15 PM, rola_51 wrote:
          > >
          > > I use an image to bring a popup window with a calendar. I found
          that
          > > an image defined as
          > > $frmProy->AddInput(array(
          > > "TYPE"=>"image",
          > > "ID"=>"image_CalFin",
          > > "SRC"=>"../js/img/CAL.GIF",
          > > "ALT"=>"Calendario-fin",
          > > "ONCLICK"=>"calFin.popup()"
          > > )
          > > ));
          > > triggers a form SUBMIT, which is not the intended behviour. If I
          > > replace the image with a button, everything works fine. Is there
          a
          > > way to inhibit the form submission via image clicks?
          > >
          > > Thanks for any suggestion...
          >
          > Just define the ONCLICK attribute like this:
          >
          > "ONCLICK"=>"calFin.popup(); return false;"
          >
          >

          The problem with this solution is that, if I have two or more such
          images on my form, or click twice on the image, I get the re-
          submission prompt, which may be confusing to the users.

          I ended up with this (not very clean, but working) solution:

          "ONCLICK"=>"calIni.popup();form_submitted=false;return false;"

          Regards and thanks again.
        Your message has been successfully submitted and would be delivered to recipients shortly.