hi all,
i am having a string whose datatype is CHAR in the database and length is 7 .
can any one help me with the javascript validation code(function) for this?
How about this? I don't know...
[tt]
function nbyte(s) {
var t;
var c=s.length;
for (var i=0;i<s.length;i++) {
t=s.charCodeAt(i);
while ((t&255)!=t) { c++; t=(t>>8);}
}
return (c);
}
[/tt]
And validate the rs field rs("charfield") like this.
[tt]
return (nbyte(rs("charfield"))==7)?true:false;
[/tt]
- tsuji
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.