Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Form with multiple onsubmit checks

Posted on 2008-10-15
6
Medium Priority
?
530 Views
Last Modified: 2013-12-25
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?
0
Comment
Question by:StevenJames
  • 2
  • 2
  • 2
6 Comments
 
LVL 16

Expert Comment

by:sh0e
ID: 22727759
<form name="frm1" method="POST" action="show.asp" onsubmit="CheckFrm1();DoThisToo();">

return stops execution and gives a value to onsubmit.
0
 
LVL 16

Expert Comment

by:sh0e
ID: 22727760
left to right
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 22728510
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Author Closing Comment

by:StevenJames
ID: 31506595
Thanks for the kick in the pants. lol
0
 
LVL 4

Author Comment

by:StevenJames
ID: 22731219
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 22734613
Great!  Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.
bol
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question