submit problem

Discussion in 'Javascript' started by david, Dec 9, 2003.

  1. david

    david Guest

    I was experiencing a false bug with safari when trying to submit a post form
    from a javascript script:

    function my_submit()
    {
    document.theForm.submit.click();
    }

    it doesn't work in the "current" version (1.0 v85.6) of Safari (nothing
    happens) while it works with mozilla (1.5) and IE. So i tried:

    function my_submit()
    {
    document.theForm.submit();
    }

    but i was having an error message in the Mac OS Console application.

    In fact, it was because of the name of my submit button:

    <input type="submit" name="submit" value="whatever">

    but if i change the name of the button:

    <input type="submit" name="Submit" value="whatever">
    ^

    then, the first method works on the 3 browsers :)

    Since i didn't find anything about that on google, i think it's a good idea to
    post it with the keywords i used for my research.

    Cheers

    --
    david
    david, Dec 9, 2003
    #1
    1. Advertising

  2. david

    david Guest

    david wrote:

    > [...]


    > then, the first method works on the 3 browsers :)


    the second method, sorry

    --
    david
    david, Dec 9, 2003
    #2
    1. Advertising

  3. david

    @SM Guest

    david a ecrit :

    > david wrote:
    >
    > > [...]

    >
    > > then, the first method works on the 3 browsers :)

    >
    > the second method, sorry


    Ah! Bon! that's better ;-)

    with your last change in name of button to submit
    try in firts method :

    function my_submit() { document.theForm.Submit.click(); }

    ==> you ask to click on the element named 'Submit',
    that's to say on the right button : submit

    --
    **************************************************************
    St├ęphane MORIAUX : mailto:
    Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
    http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
    **************************************************************
    @SM, Dec 9, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    1,678
  2. Ghafran Abbas
    Replies:
    0
    Views:
    4,193
    Ghafran Abbas
    Oct 12, 2004
  3. The Crow
    Replies:
    2
    Views:
    4,360
    Bruce Barker
    Sep 27, 2005
  4. Megha Vishwanath
    Replies:
    2
    Views:
    9,806
    tutorialsmaster
    Oct 2, 2009
  5. Joop
    Replies:
    5
    Views:
    575
Loading...

Share This Page