<asp:TextBox runat="server" ID="txtQnty" Text='<%#Eval("Quantity") %>' ForeColor="#003c71"></asp:TextBox>
<asp:Button runat="server" ID="btnUpdate" Text="Update" OnClientClick="updatealert()" OnClick="btnUpdate_Click" ForeColor="#003c71"></asp:Button>
<script type="text/javascript">
function displayalert()
{
if(document.getElementById("txtSearch").value == "")
{
alert("Enter stock number or stock description!");
return false;
}
}
</script>
<script type="text/javascript">
function updatealert()
{
if (document.getElementById("txtQnty").value == "") {
alert("Enter Quantity!");
return false;
}
else {
alert("Update Successfully!")
return true;
}
}
</script>
<script type="text/javascript">
why OnClientClick="updatealert()" is not working and displayalert() showing alert message but redirecting to error message!