Javascript submit handler

L

Lau Lei Cheong

Hello,

I have an ASP .NET form which as one imagebutton, a hidden input tag and
one dropdown select tag.

On the onchange event of the select tag, it'll change the content of the
hidden box then call form.submit to post the event.

The code would run perfectly if I use
document.getElementByID("bt_submit").click(); instead. But then it won't
work in Netscape and I wish my web application to be able to run on Netscape
as well.

I think I'm just one step towards successfully finished the page. Could
anyone give me pointer on how to assign serverside handler of a form to an
imagebutton's click handler?

Thanks in advance.

Regards,
Lau Lei Cheong
 
L

Lau Lei Cheong

Hello,

I'm afraid that the code won't do the job as in Netscape,
imagebutton.click() seems won't function at all.

Regards,
Lau Lei Cheong
 
M

M. Posseth

well instead of element by id you could use this wich will work on every
javascript 1.2 capable browser

mozilla, IE , conqueror etc etc etc

document.formname.elements['name of the element'].event or propert call
here

example
document.formname.elements['textbox1'].value='hi this is a test'; set the
propert value
document.formname.elements['textbox1'].onclick(); ' trigger event on the
control


instead of the name you could also use the index of the element

document.formname.elements[0].onclick();
 
L

Lau Lei Cheong

Sorry, my main point is that Netscape's ImageButton simply won't response to
click() method call.

I've tried the same syntax for submit button control and it works, so this
definately is not a problem related to "getElementById() not working".

Regards,
Lau Lei Cheong


M. Posseth said:
well instead of element by id you could use this wich will work on every
javascript 1.2 capable browser

mozilla, IE , conqueror etc etc etc

document.formname.elements['name of the element'].event or propert call
here

example
document.formname.elements['textbox1'].value='hi this is a test'; set the
propert value
document.formname.elements['textbox1'].onclick(); ' trigger event on the
control


instead of the name you could also use the index of the element

document.formname.elements[0].onclick();
Lau Lei Cheong said:
Hello,

I have an ASP .NET form which as one imagebutton, a hidden input tag and
one dropdown select tag.

On the onchange event of the select tag, it'll change the content of the
hidden box then call form.submit to post the event.

The code would run perfectly if I use
document.getElementByID("bt_submit").click(); instead. But then it won't
work in Netscape and I wish my web application to be able to run on Netscape
as well.

I think I'm just one step towards successfully finished the page. Could
anyone give me pointer on how to assign serverside handler of a form to an
imagebutton's click handler?

Thanks in advance.

Regards,
Lau Lei Cheong
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top