|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Allow a '.' in textfield? "Newbie Here"
if you allow only numbers such in a password, like with characterisdigit or something, how can you go back and allow certain specific characters to be entered? could someone give me a few ideas...or even one idea heh. A example wouldn't hurt my feelings either. But either way, thanks for the replies ahead of time.
|
|
#2
|
|||
|
|||
|
geez can no one help me out here?
here is one thing i tried...completely didn't work, but i tried .Code:
{
str = strInputHeight.charAt(0);
if (str == '-')
{
blnGood = true;
}
}
chatAt checks the first character....well with the (0) right? the str is defined as a integer at the top of my code...tried others but kept erroring out. and the blnGood basic is telling it to keep going if it has a '-' in it, otherwise if it were false it would error out with a message of some sort. Come on guys lend me a hand :P....Please. Thanks again. Oh and also tried something with DecimalFormat...didnt' turn out to good. |
|
#3
|
||||
|
||||
|
I don't quite understand your inital question.
You're looking to create a password validator. Right now, your code only accepts numbers and letters. You're hoping to allow it to accept other characters. If i'm not correct, please clarify |
|
#4
|
|||
|
|||
|
yes, and i am using characterisdigit to make it allow only numbers. and i need to go back and make it allow me to have decimals and negitives. figured "charAt" is my best bet. Just need to figure out how to do it.
|
|
#5
|
||||
|
||||
|
so its not letters?
only numbers (and negative decimal numbers)? Code:
double num;
num = Double.parseDouble(strInputHeight);
if (num < 0) {
// number is negative
}
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Allow a '.' in textfield? "Newbie Here" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|