# How to checkfor string variables or special characters in numeric fields?

**URL:** <https://forum.kirupa.com/t/how-to-checkfor-string-variables-or-special-characters-in-numeric-fields/148564>\
**Category:** Uncategorized\
**Created:** [May 20, 2005, 11:02pm UTC](https://forum.kirupa.com/t/how-to-checkfor-string-variables-or-special-characters-in-numeric-fields/148564 "2005-05-20T23:02:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmw](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@bmw](https://forum.kirupa.com/u/bmw)\
**Post date:** [May 20, 2005, 11:02pm UTC](https://forum.kirupa.com/t/how-to-checkfor-string-variables-or-special-characters-in-numeric-fields/148564/1 "2005-05-20T23:02:46Z")

</div>

Hi,

I have a simple calculation application. 2 inputs and when I hit submit the output is their division. I am using the following code.

on(press){  
\_parent.c1.text = Math.round(10000\*Number(\_parent.a1.text) /Number(\_parent.a2.text))/10000;  
}

where c1 is ouput number and a1 and a2 are inout nos. I want to flash an error message if somone enters special characters like ? or " and also string variables like a, b, c…

Shud I change my variables from c1.text to something else to accomodate the above ? Also, how do we code the loop for the above error check in flash?  
Please suggest.

Thanks in advance,  
Shyam.
