checking if input contain numbers or if input contain characters)

i need to know if ther is a way to know if an input contains a number,
or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
10x all.........

Comments

  • [b][red]This message was edited by aaronjones3593 at 2005-11-11 10:27:46[/red][/b][hr]
    : i need to know if ther is a way to know if an input contains a number,
    : or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
    : 10x all.........
    :
    [code]

    var to_check = "ur thing ere, number or word";
    if (isNaN(to_check))
    {
    // Word;
    }
    else
    {
    // Number;
    }

    [/code]

    hehe easy really but js was the first scripting language i learnt 5 years ago.. so :P


  • : [b][red]This message was edited by aaronjones3593 at 2005-11-11 10:27:46[/red][/b][hr]
    : : i need to know if ther is a way to know if an input contains a number,
    : : or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
    : : 10x all.........
    : :
    : [code]
    :
    : var to_check = "ur thing ere, number or word";
    : if (isNaN(to_check))
    : {
    : // Word;
    : }
    : else
    : {
    : // Number;
    : }
    :
    : [/code]
    :
    : hehe easy really but js was the first scripting language i learnt 5 years ago.. so :P
    :
    :
    :
    i began enjoying thanking you, so 10x,although i asked about isalphanum(),but if this works,ill forget about it,so 10x :):)

  • [b][red]This message was edited by aaronjones3593 at 2005-11-12 10:32:57[/red][/b][hr]
    : : : i need to know if ther is a way to know if an input contains a number,
    : : : or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
    : : : 10x all.........
    : : :
    : : [code]
    : :
    : : var to_check = "ur thing ere, number or word";
    : : if (isNaN(to_check))
    : : {
    : : // Word;
    : : }
    : : else
    : : {
    : : // Number;
    : : }
    : :
    : : [/code]
    : :
    : : hehe easy really but js was the first scripting language i learnt 5 years ago.. so :P
    : :
    : :
    : :
    : i began enjoying thanking you, so 10x,although i asked about isalphanum(),but if this works,ill forget about it,so 10x :):)
    :
    :

    may be my ignorance of the language but i dnt think there is a function by that name, u wuld have to create it urself
  • : [b][red]This message was edited by aaronjones3593 at 2005-11-12 10:32:57[/red][/b][hr]
    : : : : i need to know if ther is a way to know if an input contains a number,
    : : : : or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
    : : : : 10x all.........
    : : : :
    : : : [code]
    : : :
    : : : var to_check = "ur thing ere, number or word";
    : : : if (isNaN(to_check))
    : : : {
    : : : // Word;
    : : : }
    : : : else
    : : : {
    : : : // Number;
    : : : }
    : : :
    : : : [/code]
    : : :
    : : : hehe easy really but js was the first scripting language i learnt 5 years ago.. so :P
    : : :
    : : :
    : : :
    : : i began enjoying thanking you, so 10x,although i asked about isalphanum(),but if this works,ill forget about it,so 10x :):)
    : :
    : :
    :
    : may be my ignorance of the language but i dnt think there is a function by that name, u wuld have to create it urself
    :
    10x anyway your method is doing just fine
  • if you use vbscript instead, you can use the isnumeric function, just like in VB, greetings..


    : : [b][red]This message was edited by aaronjones3593 at 2005-11-12 10:32:57[/red][/b][hr]
    : : : : : i need to know if ther is a way to know if an input contains a number,
    : : : : : or in the contrary. i tried to use isalphanum() with javascript in asp(as in Java) but either it didn't work or it has a different way. the thing is i don't want to use isNaN(x),
    : : : : : 10x all.........
    : : : : :
    : : : : [code]
    : : : :
    : : : : var to_check = "ur thing ere, number or word";
    : : : : if (isNaN(to_check))
    : : : : {
    : : : : // Word;
    : : : : }
    : : : : else
    : : : : {
    : : : : // Number;
    : : : : }
    : : : :
    : : : : [/code]
    : : : :
    : : : : hehe easy really but js was the first scripting language i learnt 5 years ago.. so :P
    : : : :
    : : : :
    : : : :
    : : : i began enjoying thanking you, so 10x,although i asked about isalphanum(),but if this works,ill forget about it,so 10x :):)
    : : :
    : : :
    : :
    : : may be my ignorance of the language but i dnt think there is a function by that name, u wuld have to create it urself
    : :
    : 10x anyway your method is doing just fine
    :

  • : if you use vbscript instead, you can use the isnumeric function, just like in VB, greetings..
    10x weirdmix but i started with js and cannot change now,10x anyway.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories