aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes onSubmit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onSubmit" Watch "onSubmit" New topic
Author

onSubmit

michell rosvlet
Greenhorn

Joined: May 22, 2009
Posts: 23
I have a form which should validate 2 function after submit. I am not sure whether this is the right way.





Both the functions when evaluated in single are working fine. But when I combine them then only the first one get's called in this case checkBox();
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Not right.

Remember, whatever you put in the onsubmit attribute for the element forms the body of the function that serves as the event handler. If the first statement of a function is a return, can it ever execute a second statement?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

A title such as "onSubmit" is pretty brief and non-descriptive. What would happen if all posts had such a title?

Please go back and change your post to add a more meaningful subject by clicking the button on your post.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd also recommend indenting your JavaScript code to make it legible.
michell rosvlet
Greenhorn

Joined: May 22, 2009
Posts: 23
Bear Bibeault wrote:Not right.

Remember, whatever you put in the onsubmit attribute for the element forms the body of the function that serves as the event handler. If the first statement of a function is a return, can it ever execute a second statement?


Thankyou so much I got the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onSubmit