tommthumb
asked on
call asp sub from javascript function
I'm using an onSubmit form function, and I need that function to call 3 asp sub routines. They're all on the same asp page, so it shouldn't be too hard, but I don't know how to do it. I've tried just calling them directly, but they don't run.
How do I call a same page asp sub-routine from a javascript function?
How do I call a same page asp sub-routine from a javascript function?
<form name="checkout_PP_LI_Hid" onSubmit="local()" action=.../form>
<script type="text/javascript">
function local() {
email()
}
</script>
ASKER
Is there an asp equivalent of form onSubmit?
Use __doPostback() by providing unique id of the button
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Theres no reason this shouldn't work
<form name="checkout_PP_LI_Hid" onSubmit="local()" action="..." </form>
<script type="text/javascript">
function local() {
email()
}
</script>
but you would have to send the form reference with it
Why not
<form name="checkout_PP_LI_Hid" action="..." >
<input type=button value=submit name=send onSubmit="local()">
</form>
Checking the javascript during the submit process and not the form submit
<form name="checkout_PP_LI_Hid" onSubmit="local()" action="..." </form>
<script type="text/javascript">
function local() {
email()
}
</script>
but you would have to send the form reference with it
Why not
<form name="checkout_PP_LI_Hid" action="..." >
<input type=button value=submit name=send onSubmit="local()">
</form>
Checking the javascript during the submit process and not the form submit
Lee