Here is an ASP.NET code snippet that prompts the user for input. The accompanying JavaScript ensures that the user does not leave the input field empty. Now, the goal is to prevent users from entering certain characters like (|,@,#,$) using the same JavaScript function. Any ideas on how this can be achieved?
<asp:TextBox ID="txtAccountName" runat="server" Width="100%" CssClass="input" Enabled="False" onblur="CheckTxtBox(this);"></asp:TextBox>
function CheckTxtBox(sender) {
if (sender.value == "") {
alert("Please enter Address 1");
return false;
}
}