I have one question about my server side validation. I'm passing the arguments in my cffunction. Some of these arguments are FROM values populated by the user and some of them are hidden values that I have populated from data base. Hidden values will use the current values for specific fields on the form. So my question is if I pass new value in my cffunction and my hidden value then compare those two, is that enough for my server side validation? I'm wondering if there is any scenario where user can work around that validation? Or maybe better option is to create the cfquery that will pull that record directly from DB on server side instead of creating hidden field on the client side and then passing the value as an argument? Here is example of my question above:
<select name="vehicles" id="vehicles">
<input type="hidden" name="curVehicle" id="curVehicle" value="#oldVce.VehcileNum#" readonly>
<option value="">Pick the vehicle</option>
<cfloop query="myVehicles">
<option value="#vehicleNum#">#vehicleName#</option>
</cfloop>
</select>
Server side:
<cffunction name="InsertUpdateVehicles" access="remote" returnformat="JSON" output="true">
<!--- current value from drop down menu --->
<cfargument name="newVehicle" type="string" required="yes">
<!--- value from hidden field curVehicle --->
<cfargument name="oldVehicle" type="string" required="yes">
<cfset myResults = structNew()>
<cfif trim(arguments.newVehicle) NEQ trim(arguments.oldVehicle)>
<!--- Run Insert/Update --->
</cfif>
<cfreturn myResults>
</cffunction>
If anyone can help or provide an example if there is some way to work around this validation please let me know. Thanks in advance.