Substring

Giganews Newsgroups
Subject: Substring
Posted by:  Daviso (dhernand…@alumno.uned.es)
Date: Fri, 3 Feb 2006

Hi.

I hava an input like this
<td><input name=numberA> </td>

and a button with a javascript function in onclick event.

I want to control that the first element of the value I have introduced in
numberA will be different and make a conditional

for example
43543,  I want to control the first digit (4)
5433,  I watn to control the first digit(5)

I'm using "substring" but it seems doesn't work
I have:
If (document.F.numberA.value.substring(1,1) == "4")
or
If (document.F.numberA.subtring(1,1) == "4")

but no way. How can I do this????
Thanks

Replies