Hi sir,
I wrote one javascript code to prevent "space" in textbox. Its working fine in Internet explorer, but it is not working in mozilla firefox. I attached the code below for your reference. Kindly give me the solution for this problem.
Default3.aspx
*******************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script>
function AvoidSpace() {
if (event.keyCode == 32) {
event.returnValue = false;
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtEmpName" runat="server" onkeypress="return AvoidSpace()"></asp:TextBox>
</div>
</form>
</body>
</html>
With regards,
J.Prabu.
[Email:prbspark@gmail.com]