krishna angirekula

krishna angirekula

  • NA
  • 54
  • 21.7k

in my site javascript function is not calling ?

May 25 2013 12:25 AM
   function save()
         {
         
         //int count=0;
            var txt1 = document.getElementById('txtEmpFName').value; // textbox 1 ID is txt1
            var txt2 = document.getElementById('txtEmpmiName').value;
            var txt3 = document.getElementById('txtEmpDtofInterview').value;
            var txt4 = document.getElementById('txtEmpDtofJoining').value;


            if (txt1 == "0")
             {
                 count = count + 1;
                 alert("plz fill the employe's First name!!");
                 return true;
            }
            if (txt2 == "0") {
                count = count + 1;
                alert("plz fill the employe's middle name!!");
                return true;
            }
            if(txt3 =="0")
             {
                count = count + 1;
                alert("plz fill the employe's Date Of interview name!!");
                return true;
            }
            if(txt4=="0")
             {
                count = count + 1;
                alert("plz fill the employe's Date of joini name!!");
                return true;
            }
            if (confirm('Do You Want to  Add Record') == true)
                return true;
            else


                return false;
        }
 <asp:Button ID="btnadd" runat="server" class="btn save" Text="New" 
                    onclick="btnadd_Click"  OnClientClick="save();" style="height: 26px" />

i use this code also


<asp:Button ID="btnadd" runat="server" class="btn save" Text="New" 
                    onclick="btnadd_Click"  OnClientClick=" return save();" style="height: 26px" />

it not calling function .........
pls help meeeeeeeeeee

Answers (4)