Click to See Complete Forum and Search --> : can javascript submit an asp.net form


thechasboi
08-14-2007, 04:25 PM
Can javascript submit an asp.net form. Thanks for the reply.

thechasboi
08-15-2007, 01:42 PM
A resounding yes it can. The thing you as a programmer needs to do is assign a name to the button. This way .net does not assign it some weird name. Then you assign an id to that button. Once you did that you use the document.getElementById('buttonID').click(); attribute to execute the form. That is it s they say. A simple fix that I hope others can use. I use this with a pop up by the way. If the user decides to upload an image the form is submitted but if the user decides to not upload an image the and close the pop up upload window that so what the form does not submit.

thechasboi
08-15-2007, 01:48 PM
One thing you need to know, is that you can not call the button click() from the pop up. You need to set that into a function then call it from the pop up. Hope this helps others.