Re: Whats ur ctrl V right now
Mine went something like:
function kollaNummer(losen) //kontrollerar om något tecken i en sträng är en siffra
//om så är fallet ökas variabeln rakna med 1
{
for (i = 0; i < losen.length; i++)
{
var tecken = losen.charAt(i);
if (((tecken > "0") && (tecken < "9")))
{rakna = rakna + 1;}
}
return rakna;
}
That one just counts them, tho'.
Re: Whats ur ctrl V right now
:lol: :earl:
Javascript is hard enough as it is, without having to do it in non-English ;)
Re: Whats ur ctrl V right now
kollaNummer = checkNumber
lösen ~ password
tecken ~char/sign
räkna = count
I used that one to validate a password, I think. As I recall, the password had to contain a certain number of digits.
Might not be working as it is tho', I just grabbed it off some notes I had.
Re: Whats ur ctrl V right now
Quote:
Originally Posted by
Snee
Mine went something like:
function kollaNummer(losen) //kontrollerar om något tecken i en sträng är en siffra
//om så är fallet ökas variabeln rakna med 1
{
for (i = 0; i < losen.length; i++)
{
var tecken = losen.charAt(i);
if (((tecken > "0") && (tecken < "9")))
{rakna = rakna + 1;}
}
return rakna;
}
That one just counts them, tho'.
zomfg i can speak japanese, understood every word of that last sentence! :o
Re: Whats ur ctrl V right now
function checkNumber(pass) //Checks whether any sign in a string is a digit
//if that is the case, the variable count is increased by 1.
{
for (i = 0; i < pass.length; i++)
{
var sign = pass.charAt(i);
if (((sign > "0") && (sign < "9")))
{count = count + 1;}
}
return count;
}
:ermm:
Re: Whats ur ctrl V right now
Quote:
Originally Posted by
Snee
kollaNummer = checkNumber
lösen ~ password
tecken ~char/sign
räkna = count
I used that one to validate a password, I think. As I recall, the password had to contain a certain number of digits.
Might not be working as it is tho', I just grabbed it off some notes I had.
I reckon that'd work. ;)
Re: Whats ur ctrl V right now
Not really, I think it just works for 1-8 as it is, now that I looked at it again :pinch:
needs a couple of ='s.
I could prolly skip a set of parentheses as well, I think I used them 'cos I had another set of conditions at one point.
Re: Whats ur ctrl V right now
Re: Whats ur ctrl V right now
I copy-pasted it from some old notes :unsure:
Re: Whats ur ctrl V right now
i was wondering, I have some Java that I would like imbedded in my website.....erm Snee :)