View Single Post
  #3 (permalink)  
Old January 7th, 2009, 05:05 AM
ismailc ismailc is offline
Authorized User
Points: 383, Level: 6
Points: 383, Level: 6 Points: 383, Level: 6 Points: 383, Level: 6
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Jan 2007
Location: durban, Africa, South Africa.
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Question

Hi, Thank You.

I have dev tool that uses asp + xslt page.
On the dev tool I have objects, text box with poperties & events i can use.
The problem i have is that I only want a numeric value in a textbox of datatype text. Don't want to change it to numeric as it rounds/trims the value when wanting to do a calulcation.
So in the xslt file i want to add a javascript function that i can use on the onkeyevent of the textbox not to allow numeric characters.
Still struggling though!
The function between the <![CDATA[ is like it is filtered out (font light grey) and can't use the function.
<SCRIPT TYPE='text/javascript'>
<![CDATA[
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
]]>
</SCRIPT>
Reply With Quote