Restricting spaces in textbox using JavaScript.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 299
Write below Javascript code:-
<script type = "text/javascript">
function DisableSpace()
{
if (event.keyCode == 32)
{
event.returnValue = false;
return false;
}
}
</script>

<asp:TextBox ID = "txtLoginID" onkeypress = "return DisableSpace();" runat = "server"></asp:TextBox>

Comments or Responses

Login to post response