• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mobile number validation?

 
David Mathie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Am I doing something wrong here? No compilation errors but code doesnt seem to be working. IF mobile number input is less than 11 numbers an error message dialog appears to alert the user then is supposed to focus on the text box in question. But instead after clicking the ok on the dialog box, the next rooms form shows up even though ive set that to setVisible(false). Any help would be appreciated. Thanks.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding this before your if statement
 
David Mathie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did that. I added that code and it does print out that the number is less than 11 but still shows the next form? I'm really stuck. Thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will get better help if you post your SSCCE. With the code you post, we can just guess.
Are you sure the input does not have white spaces? If yes, they are a legal character which will be "counted" To get rid of them call trim()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!