Discussion:
Form Update Queston
(too old to reply)
h1SEO
2009-03-18 15:44:40 UTC
Permalink
I'm building a form that sends info to a database.
The form can be submitted if the field DateHRReceived is Null or has a date.
However, If DateHRReceived is a date in the database, it cannot be updated to
Null.
It should give an error message on submit.
I'm new, so I'm not sure what I need to do.
Thanks!



<cfquery name="EvaluationData" datasource="AGENCY_Personnel">
SELECT EmplID, EvaluationID, EvaluationTypeID, DateDue, EmployeeRating,
SupervisorRating, PlanOfAction, NewHire, HireDate, TrainingRequired, Comments,
DateHRReceived, UpdatedBy, DateHRReceived, DateUpdated
FROM EvaluationData WHERE EmplID = #URL.EmplID# AND (Deleted = 'false')
</cfquery>

<cfinput name="DateHRReceived" type="text"
value="#DateFormat(EvaluationData.DateHRReceived, "mm/dd/yyyy")#" size="31">
Aaron West
2009-03-19 00:39:23 UTC
Permalink
You could perform some client-side validation checks using JavaScript. I'd also
recommend performing server-side validation with ColdFusion. There are a ton of
JavaScript libraries that can help you wire up the validation or you can "roll
your own" validation function that ensures the form input values are what they
need to be.

ColdFusion also has additional attributes to the CFINPUT tag that will
essentially cause JavaScript to be written to the document <head> that does
your client-side validation for you.

More info on the different attributes of the CFINPUT tag are here:
http://cfquickdocs.com/#cfinput
Semaphorians
2009-03-20 10:02:29 UTC
Permalink
You could store the date coming from select query in a hidden field also, and on submit you could preform both client side and server side validations and can show specific error messages.
Loading...