Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
textfield validation

 
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum
Author Message
Guest
Guest





Post Post subject: textfield validation Reply with quote

hello everyone, i need to know how i can validate my text filed. i like to see only numbers in my text field. how can i protect other non-numeric characters to b entered.

code module is preferable
Fahad
Wed Apr 14, 04 7:51 am
Back to top
Guest
Belal
User
User


Joined: 08 Mar 2004
Posts: 84
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

here is the code. hope this will help u.

myTextField.addKeyListener(new KeyAdapter()
{
public void keyTyped(KeyEvent ke)
{
char key=ke.getKeyChar();
if (!(((key >= '0' && key <= '9')) || (key == '.')))
ke.consume();
}
});

inform m if it works.....
Wed Apr 14, 04 7:55 am
Back to top
Belal View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group