Here is an experment that did and it works for IE, someone on the list may
have the equivilent for NS.
Here are the docs for all the char codes.
http://msdn.microsoft.com/workshop/author/dhtml/reference/charsets/charset1.
asp

Basicaly I just added an event to the input tag after it was loaded and told
it to check every key strock for the keyCode 46 (.) and return keyCode = 0
instead. It's not pretty but it may give you some idea's.

Heres the page
------------------------
<html>
<head>
<script>
function addValidation()
{
 document.foo.barr.attachEvent('onkeypress',badChar)
}

function badChar()
{
if (event.keyCode == 46 && event.srcElement.value.length <= 0)
 {
 event.keyCode = 0;
 alert();
 return true;
 }
}
</script>
</head>
<body onload="addValidation()">
<CFFORM ACTION="#SCRIPT_NAME#" METHOD="POST" ENABLECAB="Yes" NAME="foo">

<CFINPUT TYPE="Text"
       NAME="barr"
       MESSAGE="no way"
       VALIDATE="integer"
       REQUIRED="yes"
       SIZE="10">
<BR>
<INPUT TYPE="submit" VALUE="go">
</CFFORM>
<SCRIPT>

</script>
</body>
</html>
---------------------
----- Original Message -----
From: "Michael S. Kimmett" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, May 16, 2001 4:37 PM
Subject: CFINPUT -- not validating Integer


> Howdy,
>
> I am trying to get the CFINPUT Tag to validate an integer on a form.  The
darn tag will validate SSN, zipcodes, etc, but when I enter the integer
parameter and test the validation using the following value ( .3 or any
value that starts with a decimal point ) the javascript validation fails (
the js allows the value to pass).
>
> Does anyone know if this is a bug in CF 4.5 and something that I will just
have to live with?
>
> Michael
>
> <CFFORM Name="Test" ACTION="appCFINPUTTEST.cfm">
>  <CFINPUT Type="Text" Name="Number1" Required="yes"
>     validate="integer"  Message="You did not provide a correct Integer!"
>    Size="20" Maxlength="30">
>
> <BR>
> <INPUT Type="Submit" Name="Submit" Value="Submit">
> </CFFORM>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to