Ask a Question related to Coldfusion Database Access, Design and Development.
-
design in progress #1
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, pls...
Regards.
Design...desperate.
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:confused
Mark this message as the answer.
Edited: 05/23/2005 at 02:14:08 AM by design in progress
Print this message
Report this to a Moderator
gclausen
User is offline
Member Posts: 65
Joined: 04/09/2001
05/23/2005 01:46:30 PM
Reply | Quote | Top | Bottom
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>
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... -
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... -
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... -
How to get value entered in one file to a pop-up open new window's field??
I has a form(file : hdnews.asp)...with many fields including user id, name and contact no.On submit, the system will post the data. Beside the... -
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... -
OldCFer #2
Re: SOS! To validate if form field entered by user isvalid number (not a negative value)
This should work.
<input type="text" name="test"><br>
<input type="hidden" name="test_required">
<input type="hidden" name="test_range" value="min=0 max=10000">
OldCFer Guest



Reply With Quote

