Re: Can I execute a javascript action before uploading a file?
- From: "AndrewF" <andrew@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 20 Aug 2005 10:52:21 -0700
Hi Mark.
You can make the page behave like it has been submitted just with a bit
of javascript.
By default an ASP:Button object can fire an OnClick event to call a
function back on the server side. This however is essentially an
argument passed to the postback handler though and then ASP.NEt picks
it up server side before any of your processing begins and executes the
function.
So the way to fool it is keep the page as you have it now, all working
fine but the extra function you want called not being called. Once you
have it absolutely working for a basic click take a look at the code
and in particular look at the Javascript the input button calls which
ultimately results in a __doPostBack().
Trace through the function parameters and now you know the bit of JS
you need to call and what parameters to pass it in order to make the
Submit_OnClick function work on the server.
Simply change the ASP:Button object into a plain old html button
instead that with it's OnClick event fires your JS function that
disables all the buttons etc and from that function submit the form
with the JS function call you traced from the old button...
Cheers
AndrewF
.
- Follow-Ups:
- Re: Can I execute a javascript action before uploading a file?
- From: Mark Miller
- Re: Can I execute a javascript action before uploading a file?
- References:
- Can I execute a javascript action before uploading a file?
- From: Mark Miller
- Can I execute a javascript action before uploading a file?
- Prev by Date: How to writexml website < -- > PC
- Next by Date: Re: File Upload Question
- Previous by thread: Can I execute a javascript action before uploading a file?
- Next by thread: Re: Can I execute a javascript action before uploading a file?
- Index(es):
Relevant Pages
|