Cibun Swain

Cibun Swain

  • NA
  • 257
  • 50.4k

Calling 2 return functions on a single button click

Jun 23 2014 2:40 AM

hi,Dear

i am going through an issue that is i need to call 2 javascript functions  on single button click and prior to that both functions have return statement.......

EX:

<asp:button id="btnAdd" runat="server" onClientClick="return fun1();fun2()"/>


function fun1()
{
if(....)
{
   return true;
}
else
{
alert("invalid1");
return false;
}
}


function fun2()
{
if(....)
{
   return true;
}
alert("invalid1");
return false;
}

by doing this i am getting the issue i,e " for fun1() its fine but for fun2().. though the alert is firing but page is posting back to server...

so definitely i am dong something wrong while calling the function..so please resolve my issue..if anyone can..

waiting for reply

thanks & regards
Cibun swain


Answers (1)