Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Field validation=float ??

Status
Not open for further replies.

Katiris

Programmer
Feb 23, 2005
25
0
0
US
Good Morning

I have created a form that updates multiple rows with the help of the formum. In the form I have numeric data that is of type float. The current situation is if I try to update one record and another on the form is over 999.99
then I get an error indicating trouble with the record whose value is over the 999.

my code -

<cfinput type="text" name="POCAmount_#sectionID#" value="#DecimalFormat(POCamount)#" validate="float" size="10" maxlength="15" style="text-align: right;">

The _#sectionID# makes the field dynamic for the update. I don't know java script so trying for me to try to validate using js totally .... hard

I'm open for suggestions! Can anyone help!
 
my suggestion would be not to use cfform.

if floating point validation is a MUST and you don't know JS, then i'd do it CF side.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Oddly enough if I don't use cfform some of the other things don't work. I will play around with it and see what other combinations I can try and maybe I can get it to work. It just seems odd to me that it works if its under 1,000.00 and doesn't if over.

Thanks for your effort.
 
What does your error say? I could be that your database isn't set up to take over 999.99.

Oddly enough if I don't use cfform some of the other things don't work.
Like what?



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
The database takes it. Because if I go to the line thats over 1000 and take the comma out it works. It's only erroring on the comma.

Error in POCAmount_sectionid text

Remove the comma and it works fine. Plus its an established database set to be a float field
 
I'm going to use <cfCrystalBall> here...

if you don't use cfform, you can't use cfinput so change cfinput to <input> and take out the cf stuff. That's probably your "oddly enough" stuff comes from.

once you put the , in a number technically it isn't a number anymore, its a string. which is probably where your other problem is.

ECAR haven't seen you in a while/much. welcome back!!

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I'll give it a try and let you know. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top