By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

how to submit ?

P: n/a
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
programmatically.

(example: user input fields (like type TEXT) can be filled with values
via javascript. similarly how to click or run the "submit" type ?)
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <af**************************@posting.google.com >,
br*********@yahoo.com enlightened us with...

how does one run (or click) the submit button via javascript.


document.myFormName.mySubmitButtonName.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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2

P: n/a
kaeli wrote:
In article <af**************************@posting.google.com >,
br*********@yahoo.com enlightened us with...
It should be an attribution line, not an attribution novel ;-)
how does one run (or click) the submit button via javascript.


document.myFormName.mySubmitButtonName.click();

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


document.forms['myFormName'].elements['mySubmitButtonName'].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?
[...]


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

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.