Validate and display error message with fade animation using jQuery

ahmetkilicpa
 
on May 14, 2013 04:43 AM
3849 Views

how can we use this script function in the other script function;

First;
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
   <script type="text/javascript">
       $(function () {
           //Hide label after 5 secs
           setTimeout(function () {
               $("[id$=lblError]").fadeOut("slow");
           }, 5000);
       });
   </script>
   <asp:Label ID="lblError" ForeColor = "Red" runat="server" Text="Name is required."></asp:Label>
 
Second ;
 

<script type="text/javascript">
function ValidateDropDown() {
var value = document.getElementById('<%=TextBox1.ClientID%>').value;
var value2 = document.getElementById('<%=TextBox2.ClientID%>').value;
var ddlVal = document.getElementById("DropDownList1").selectedIndex;

if (value == "" && (ddlVal == 0) && (value2 == "")) {


alert("Lütfen bir kriter seçiniz..");
return false;
//}

}
else {
//alert("The selected value is : '" + document.getElementById("DropDownList1").value + "'");
alert("Başarıyla yönlendiriliyorsunuz..");

}
}
</script>

 

 

in the;

if (value == "" && (ddlVal == 0) && (value2 == "")) {

*******************************I want to run first script function in here
alert("Lütfen bir kriter seçiniz..");
return false;
//}

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Mudassar
 
on May 14, 2013 08:16 AM
Instead of saying thanks mark the reply or replies(if multiple) that helped as Answer.