Connecting Tech Pros Worldwide Forums | Help | Site Map

How to call two javascript functions onclick of a submit button?

Newbie
 
Join Date: Feb 2008
Posts: 4
#1: Feb 27 '08
Hello every one,

I am using VS 2005, I am having selection of From & To dates in every page of project, for validation of these two fields I written common javascript function in master page, I am calling this function on attributes property of button.
Now I want to validate other controls of the pages too, which has to be written in that page itself. So how can I achieve this?

I tried this
btnSubmit.Attributes.Add("onclick", "return validatesas();return check();");

but only 1st function validatesas() is executing, if I replace function check() on 1st position, then only check() is executing.

Newbie
 
Join Date: Feb 2008
Posts: 3
#2: Feb 27 '08

re: How to call two javascript functions onclick of a submit button?


You may have to combine the two Javascript functions into one and just call that. Additionally, you can add the call on click attribute in the declaration of the button, with simply the onclick="function()" attribute.
Reply