Originally posted by Narasimha Raju Naidu: condition is "i must and should take only characters and blank spaces"
What else is there? Everything you can type into a text field is a character.
Assuming you meant that you want to limit to a particular type of character, such as alphabetic characters, you can achieve this by: establish a keydown handler on the text field, check the key code of the entered character, and stop the event's default handling if the character is one that you wish to block.
The details of doing so are browser-dependent so I;d suggest using a library such as Prototype that allows you to handle events in a browser-independent manner.