Click to See Complete Forum and Search --> : Call a submit button by code


Babak
02-06-2003, 10:27 AM
I have a form with Id="Form1" and a submit button withId="btnSearch".
I want to click it as user clicks another button in the form.I use the following synatax

<INPUT type="button" value="Submit" onclick="Form1.btnSearch.Click()">

but I get an error.
Any help appriciated

Webskater
02-06-2003, 11:12 AM
Originally posted by Babak
I have a form with Id="Form1" and a submit button withId="btnSearch".
I want to click it as user clicks another button in the form.I use the following synatax

<INPUT type="button" value="Submit" onclick="Form1.btnSearch.Click()">

but I get an error.
Any help appriciated

try:
onclick="Form1.btnSearch.click()">
javascript is case sensitive and click is all lower case.

Zach Elfers
02-06-2003, 02:31 PM
Or do:

<input type="button" value="Submit" onClick="this.form.submit();">

Babak
02-06-2003, 02:50 PM
It worked
Thanks