By definition, you cannot get anything like strong typing with JavaScript. It is based on a very different paradigm,
loose typing, more exactly,
dynamic and
duck:
http://en.wikipedia.org/wiki/JavaScript[
^],
http://en.wikipedia.org/wiki/Dynamic_typing[
^],
http://en.wikipedia.org/wiki/Duck_typing[
^].
As a matter of fact, there are only 9 distinct types in JavaScript, and only one of them is relevant to text boxes:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof[
^].
You can create some pale imitation of strict typing if you compare the
constructor
objects of the objects.
For the detail on this idea, please see my past answers:
Is this code correct?[
^],
WHy does this happen? Js[
^],
which datatype is this[
^].
In view of that, the "strongly typed text boxes" is something irrelevant. All you need is to enforce typing of some text box content by filtering out the characters typing. This is explained in detail here:
http://www.javascripter.net/faq/keyboardinputfiltering.htm[
^].
Another approach would be using some
MaskedTextBox
, or validation when the data is about to be used, or the combination.
If you want to take some "strict typing" route with JavaScript, first examine the sanity of your approach. Please read this:
http://davidwalsh.name/javascript-objects-distractions[
^].
—SA