Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
solution of prevent space in textfield
-------------------------
JavaScript
<script type="text/javascript">

        $(document).ready(function () {
            $("#txtLogin").keydown(function (event) {
                if (event.keyCode == 32) {
                    event.preventDefault();
                }
            });
        });
    
    </script>

where #textLogin is ID of textfile..........
Posted
Updated 25-Apr-12 2:19am
v2
Comments
Sandeep Mewara 25-Apr-12 9:11am    
You asking question or sharing something?
bbirajdar 25-Apr-12 9:17am    
If you are sharing the solution, then please add it in the Tips and Tricks section.
raees ahmed khan 28-Apr-12 8:19am    
okay

1 solution

This looks like a Tip that you want to share with others.

Post here as a Tip/Trick: http://www.codeproject.com/script/Articles/Submit.aspx[^]
 
Share this answer
 
Comments
VJ Reddy 26-Apr-12 5:18am    
Good suggestion. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900