|
 |
asp_databases thread: data type check
Message #1 by "Neetu Dhatt" <neetu_dhatt@h...> on Wed, 08 Jan 2003 00:05:45 +0000
|
|
hey guys
i am trying to validate data types within a function inside <script></script>
eg
<script>
function SubmitData() {
//This is the function for validating that all the information is entered for each text field
bIsValid = true;
//To check see if Area contains a value
if(EditCommunityShopping.idArea.value == "")
{
alert ("You must select an Area");
EditCommunityShopping.idArea.focus();
bIsValid = false;
}
</script>
this function is called on -- onclick
this works fine but i want to check if the value entered for Sales is numeric and not characters
and also to check if the area entered is characters and not numeric
i tried doing the following but it doesn't work
if not isnumeric(EditCommunityShopping.idSales.value)
{
alert ("You must enter numeric value for sales");
EditCommunityShopping.idSales.focus();
bIsValid = false;
}
the above doesn't work. It doesn't recognize --not isnumeric
anyone know what to do instead. I will really appreciate itMSN 8: advanced junk mail protection and 2 months FREE*
Message #2 by Bimal Panda <bimal@o...> on Tue, 7 Jan 2003 19:47:54 -0800 (PST)
|
|
in stead of isnumeric use isNan for checking numeric.
--- "Neetu Dhatt" <neetu_dhatt@h...> wrote:
>
>hey guys
>i am trying to validate data types=A0within a function inside <script></sc
ript>
>eg
><script>
>function SubmitData() {
>//This is the function for validating that all the information is entered
for each text field
>bIsValid =3D true;
>//To check see if Area contains a value
>if(EditCommunityShopping.idArea.value =3D=3D "")
>{
>=A0alert ("You must select an Area");
>=A0EditCommunityShopping.idArea.focus();
>bIsValid =3D false;
>=A0}
>
></script>
>this function is called on -- onclick
>this works fine but i want to check if the value entered for Sales is nume
ric and not characters
>and=A0also =A0to check if the area entered is characters and not numeric
>i tried doing the following but it doesn't work
>=A0
>if not isnumeric(EditCommunityShopping.idSales.value)
>
>{
>=A0alert ("You must enter numeric value for sales");
>=A0EditCommunityShopping.idSales.focus();
>bIsValid =3D false;
>=A0}
>the above=A0doesn't work.=A0 It doesn't recognize --not isnumeric
>anyone know what to do instead.=A0 I will really appreciate itMSN 8: advan
ced junk mail protection and 2 months FREE*
>
>to unsubscribe send a blank email to leave-asp_databases-2069536K@p...
.com.
_____________________________________________________________
http://www.on-lyne.com - Seamless Solutions Across Borders !!
_____________________________________________________________
Select your own custom email address for FREE! Get you@y... w/No
Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=3Dtag
|
|
 |