Reputation: 11
Seems like this should be pretty straight forward, but I'm stumped.
Let's say I have a variable called "TheNumber", the value of that number is 123.56
. I want to display that number as a rounded number, or 124
. If I use the input code below, it will display as 124
, but when I submit the form it passes (123.56, 124
) and thus an error.
<cfinput type="text" name="MyNumber" size="3" value="#NumberFormat(TheNumber, 999)#">
I only want the 124
value to insert into the database. I've tried rounding the number, both in and out side the input tag, but I still get the same result. What am I missing?
Upvotes: 1
Views: 131
Reputation: 29870
You have a second input
with the same name in that form with the original value. Remove it.
Also, as Duncan says: there's almost no reason to use <cfinput>
in this situation.
Would you consider posting your entire form to Code Review for us to look at and suggest how to stop using <cfform>
/ <cfinput>
?
Upvotes: 2