how to submit ?

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

    how to submit ?

    i have a form that gathers user inputs and has two submit buttons.

    according to the input received (via user input) the appropriate
    submit button is clicked (by the program).
    the form would have a ACTION that actually runs a script on the web
    server once the submit button is clicked or run.

    how to do the following with javascript ?

    how does one run (or click) the submit button via javascript. it is
    not the user who is clicking the submit button but has to be done
    programmaticall y.

    (example: user input fields (like type TEXT) can be filled with values
    via javascript. similarly how to click or run the "submit" type ?)
  • kaeli

    #2
    Re: how to submit ?

    In article <af10786c.03101 60856.246501b8@ posting.google. com>,
    brian_dell3@yah oo.com enlightened us with...[color=blue]
    >
    > how does one run (or click) the submit button via javascript.[/color]

    document.myForm Name.mySubmitBu ttonName.click( );

    I have no clue if every major browser supports that, but IE6 does.

    -------------------------------------------------
    ~kaeli~
    Jesus saves, Allah protects, and Cthulhu
    thinks you'd make a nice sandwich.


    -------------------------------------------------

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: how to submit ?

      kaeli wrote:
      [color=blue]
      > In article <af10786c.03101 60856.246501b8@ posting.google. com>,
      > brian_dell3@yah oo.com enlightened us with...[/color]

      It should be an attribution line, not an attribution novel ;-)
      [color=blue][color=green]
      >> how does one run (or click) the submit button via javascript.[/color]
      >
      > document.myForm Name.mySubmitBu ttonName.click( );
      >
      > I have no clue if every major browser supports that, but IE6 does.[/color]

      document.forms['myFormName'].elements['mySubmitButton Name'].click()
      is better and working in Mozilla/5.0 rv:1.5.

      It is to be noted that submitting information without user control (even if
      caused by user input in another document) may display a web site not to be
      trustworthy. And without JavaScript nothing of the above works, so the user
      must "click" the "button" anyway.

      Brian, could you explain why this is necessary?
      [color=blue]
      > [...][/color]

      Please use dashDashSpace (`-- ') to separate your signature (max.
      4 lines à max. 80 characters), as described in RFC 850 and 1855.


      PointedEars

      Comment

      Working...