Form with multiple onsubmit checks

I have a couple functions in a form's OnSubmit event.
<form name="frm1" method="POST" action="show.asp" onsubmit="return CheckFrm1();return DoThisToo();">
But only one get's executed. Can I put multiple functions here?

Also is there an order of events (which get's ececuted first) Left to right?
LVL 4
StevenJamesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
StevenJames,

Can't you combine them or create a third that runs those functions and returns true/false to the submit?

If not then try ...

onsubmit="return (CheckFrm1() && DoThisToo());"

I haven't tried it like that so let me know if it doesn't work.  In a quick test it worked for me. :)

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
sh0eCommented:
<form name="frm1" method="POST" action="show.asp" onsubmit="CheckFrm1();DoThisToo();">

return stops execution and gives a value to onsubmit.
0
 
sh0eCommented:
left to right
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
StevenJamesAuthor Commented:
Thanks for the kick in the pants. lol
0
 
StevenJamesAuthor Commented:
Thanks b0lsc0tt,

You gave me the idea of looking at other events, and since the user clicks on the submit button, I put the check in there, then my todostuff in the form's OnSubmit.

Works!
0
 
b0lsc0ttIT ManagerCommented:
Great!  Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.
bol
0
All Courses

From novice to tech pro — start learning today.