Ask a Question related to Coldfusion Database Access, Design and Development.
-
design in progress #1
Validate if form field entered by user is valid number(not a negative value)
Thank you so much for reading my question.
Hi,
I have a actionpage that allows update of information/price to my database.
My form page consists of a price field(display in dollarformat) and I wanted
to validate if the user has keyed in a negative price value.
I have tried hidden type with name=price_range, value=MIN="0", but does not
work. (Pls note: I have also declared hidden type _required, _float prior to
the _range)
But the funny thing is that another form field (of numeric value) has the same
hidden type declaration (_required, _float, followed by_range) as the "price",
and it works perfectly.
My question is:
Is the _range only applicable for numeric values? If it really does, then how
should i go about validating my price (in currency)?
Pls help me if you know.
Millon thanks in advance.
Regards,
A novice in Coldfusion
design in progress Guest
-
How do I validate the values entered for custom control properties?
I have a custom control with properties named MinValue, MaxValue, and Value (all of which I have assigned a DefaultValue design-time attribute). The... -
SOS! To validate if form field entered by user is validnumber (not a negative value)
Pls see my question as below... gclausen, This is actually a school assignment, which doesn't allow the use of Javascript. Anyone can help,... -
Counting the number of times a user hits an html form
I have a very long html form with many loops in it. I'm trying to keep track of how many times a user hits a specific web page while they are... -
Validate 1st field on form
Hi I have a form that users fill in, thefirst field is a username, which must be unique. Currently only when I attempt the Insert into the DB... -
Automatically update a field when another field is entered.
I am trying to create a field in a form that will be automatically populated when another field is entered. I have facility names with related ID... -
gclausen #2
Re: SOS! To validate if form field entered by user isvalid number (not a negative value)
Use the cfinput "onValidate" attribute to call a client side javascript
function. Like this:
<script language="JavaScript1.2">
function isgtZero(oForm, oTag, dValue){
var tmp = dValue.substring(1,99) - 0; // strip out the $ and convert to
numeric datatype
if( tmp > 0 ) return true; // else returns false
}
</script>
<body>
<cfform method="POST" action="cfform_action.cfm">
<cfinput name="dollarField" onvalidate="isgtZero" message="Must be greater
than zero" value="$400">
<input type="Submit">
</cfform>
gclausen Guest
-
design in progress #3
Re: SOS! To validate if form field entered by user isvalid number (not a negative value)
gclausen,
thanks for helping, I am sorry but I am not allow to use Javascript. Only CFML...any clue?
Thanks again...
Regards,
Design in need of help. :confused;
design in progress Guest



Reply With Quote

