javascript type cast
| From: | Josh Close | Date: | Tue, 03 Aug 2004 16:28:16 +0000 |
| Subject: | javascript type cast | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192541@lists.php.net to get a copy of this message | ||
Is there any way to do a typecast in javascript? I know you can in
2.0, but that won't work here.
I have an input field and I need to add a number to it's value.
var + 123 == 'var123'
You would think that it would automatically typecast var to an int
since it's being added to one, but it just concatenates it instead.
How can I add (or sum) the two values?
P.S. I'm doing this in a php page... that's why I'm asking here.
-Josh