Ask a Question related to Coldfusion Database Access, Design and Development.
-
whatsaname #1
Validation of records
How can i validate if a record number in the Database NOT exist, and that an
error message will be returned to the user,
that a wrong number has been entered.
The code i'm having sofar is :
<cfparam name="FORM.issue_number" default="1">
<cfquery name="rs_issue" datasource="issue">
SELECT *
FROM tbl_issue
WHERE issue_number = #FORM.issue_number#
</cfquery>
whatsaname Guest
-
CFFORM validation trumping Custom Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
CFFORM Validation trumping Custom Form Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
'Either Or' Validation
This might not be an advanced topic, but I need to be able to validate an HTML form, and for that matter, Flash forms, to check that the user... -
validation summary doesnt display when there's client-side validation
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so... -
only custom validation control does server side validation?
On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator... -
Dan Bracuk #2
Re: Validation of records
Run a select query and use the recordcount variable.
Or run a select count(fieldname) as thecount query with the appropriate where
clause and use the queryname.thecount value.
Originally posted by: whatsaname
How can i validate if a record number in the Database NOT exist, and that an
error message will be returned to the user,
that a wrong number has been entered.
The code i'm having sofar is :
<cfparam name="FORM.issue_number" default="1">
<cfquery name="rs_issue" datasource="issue">
SELECT *
FROM tbl_issue
WHERE issue_number = #FORM.issue_number#
</cfquery>
Dan Bracuk Guest
-
_silence #3
Re: Validation of records
<cfparam name="FORM.issue_number" default="">
<cfquery name="rs_issue" datasource="issue">
SELECT *
FROM tbl_issue
WHERE issue_number = #FORM.issue_number#
</cfquery>
<cfif not rs_issue.recordcount>
No records found.
</cfif>
_silence Guest
-
whatsaname #4
Re: Validation of records
I'm not that familar with database quiries rahter than the simple recordsets.
I've tried to find how to make the quiry that runs the RECORDCOUNT, but i can
not find that.
Could you please assist me a bit?
Thanks
whatsaname Guest
-
_silence #5
Re: Validation of records
All queries ran with cfquery return the following variables in the query scope:
query_name.currentRow
Current row of query that cfoutput is processing
query_name.columnList
Comma-delimited list of the query columns
query_name.RecordCount
Number of records (rows) returned from the query
cfquery.ExecutionTime
Cumulative time required to process the query
They can all be referenced in CF after the query is executed by using
query_Name.recordcount (where query_Name is the actual name of your query),
etc...
For more information see:
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-b19.htm[/url]
_silence Guest
-
whatsaname #6
Re: Validation of records
Thank you so much, now i've got the clue, and it is working.
I've place the CFIF where thhe output is expected
("<cfoutput>#Form.issue_number# <cfif not rs_issue.recordcount>
DOES NOT EXIST</cfif></cfoutput>"
Again Great Help.
whatsaname Guest
-



Reply With Quote

