submit

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

    submit

    Why this work?

    <a href="#" onClick="Forma1 .reset()">Link1 </a>

    and this not?

    <a href="#" onClick="Forma1 .submit()">Link 1</a>

    I get error.

    Thanks!

    --

    Andrej Levenski
    PROVOX - Multimedia Studio
    mob 098/326 897
    tel 01/6184 612
    andrej@provox.h r


  • Stuart Palmer

    #2
    Re: submit

    What doesn't work? what browser?

    Works for me in IE 5.5 it may be that you need to return false after the
    reset to stop for form from submitting.

    Stu

    "LevaOpaki" <levaopaki@net. hr> wrote in message
    news:boo9rr$674 $1@ls219.htnet. hr...[color=blue]
    > Why this work?
    >
    > <a href="#" onClick="Forma1 .reset()">Link1 </a>
    >
    > and this not?
    >
    > <a href="#" onClick="Forma1 .submit()">Link 1</a>
    >
    > I get error.
    >
    > Thanks!
    >
    > --
    >
    > Andrej Levenski
    > PROVOX - Multimedia Studio
    > mob 098/326 897
    > tel 01/6184 612
    > andrej@provox.h r
    >
    >[/color]


    Comment

    • David Dorward

      #3
      Re: submit

      LevaOpaki wrote:
      [color=blue]
      > Why this work?
      > <a href="#" onClick="Forma1 .reset()">Link1 </a>[/color]
      [color=blue]
      > and this not?
      > <a href="#" onClick="Forma1 .submit()">Link 1</a>[/color]

      Becuase one changes the form, then goes to a URI. The other goes to a URI,
      and then goes to a different URI before anything can happen.

      .... but read:
      * http://jibbering.com/faq/#FAQ4_24 (note the use of the word 'meaningful')
      and
      * http://tom.me.uk/scripting/submit.asp
      [color=blue]
      > I get error.[/color]

      Really? Then you probably have an input named submit.

      --
      David Dorward http://dorward.me.uk/

      Comment

      • LevaOpaki

        #4
        Re: submit


        "LevaOpaki" <levaopaki@net. hr> wrote in message
        news:boo9rr$674 $1@ls219.htnet. hr...[color=blue]
        > Why this work?
        >
        > <a href="#" onClick="Forma1 .reset()">Link1 </a>
        >
        > and this not?
        >
        > <a href="#" onClick="Forma1 .submit()">Link 1</a>
        >
        > I get error.
        >
        > Thanks![/color]

        Thanks to all.
        I find error.
        My other submit button name was "submit". :)))


        Comment

        • LevaOpaki

          #5
          Re: submit


          "Stuart Palmer" <tryandspamme@y oucant.com> wrote in message
          news:boobuj$s0i $1@sp15at20.hur sley.ibm.com...[color=blue]
          > What doesn't work? what browser?
          >
          > Works for me in IE 5.5 it may be that you need to return false after the
          > reset to stop for form from submitting.[/color]



          <a href="javascrip t:document.Form a1.submit();">S ubmit </a>

          I try this now and not working.
          Forma1 is my form name.
          Reset is working good.
          Always troving an error.

          "
          A Runtime Error has occurred.
          Do you wish to Debug?

          Line: 0
          Error: Object doesn't support this property or method
          "

          I'm using IE 6.0

          Thanks!


          Comment

          • Grant Wagner

            #6
            Re: submit

            LevaOpaki wrote:
            [color=blue]
            > Why this work?
            >
            > <a href="#" onClick="Forma1 .reset()">Link1 </a>
            >
            > and this not?
            >
            > <a href="#" onClick="Forma1 .submit()">Link 1</a>
            >
            > I get error.
            >
            > Thanks![/color]

            Without more information I'm guessing, but my guess is that you
            have a form element named "submit" on your form, such as:

            <input type="submit" name="submit" value="Go" />

            If you have something similar to the above line, change the name
            of this input element to something other then "submit".

            Also, never just refer to the name of the form, your code will
            work in Internet Explorer, but will fail in almost every other
            browser, because "Forma1" will be undefined.

            <a href="#" onclick="docume nt.forms['Forma1'].submit();retur n
            false;">Link 1</a>

            The "return false" is also necessary. It may seem to be
            unnecessary because the submit() means it never executes,
            however, in at least one web browser (Internet Explorer 5) the
            onclick event fires, begins to submit the form, then immediately
            follows the HREF attribute, cancelling the form submission. The
            net effect is that in IE5, calling submit() as shown above
            without returning false appears to do nothing.

            Lastly, the link above will only work if JavaScript is enabled, a
            solution similar to the one below will make the form work
            regardless of client-side JavaScript support:

            <style type="text/css">
            input.submitBtn {
            background-color: transparent;
            border: none;
            text-decoration: underline;
            color: blue;
            cursor: pointer;
            cursor: hand;
            }
            </style>
            <form>
            <input type="submit" id="submitId" name="submitNam e"
            value="Click here" class="submitBt n" />
            </form>

            --
            | Grant Wagner <gwagner@agrico reunited.com>

            * Client-side Javascript and Netscape 4 DOM Reference available
            at:
            *


            * Internet Explorer DOM Reference available at:
            *
            Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


            * Netscape 6/7 DOM Reference available at:
            * http://www.mozilla.org/docs/dom/domref/
            * Tips for upgrading JavaScript for Netscape 7 / Mozilla
            * http://www.mozilla.org/docs/web-deve...upgrade_2.html


            Comment

            Working...