[TerraForm] field rawvalue

  • From: "Malessa Korotnicki" <malessa.korotnicki@xxxxxxxxxxxxxxxxxxxxxx>
  • To: terraform@xxxxxxxxxxxxx
  • Date: Mon, 5 Apr 2004 14:35:11 +1000

Hi Matt,

I'm setting up a multipage form that adds each field in a page to the
session scope as it progresses through the pages of the form. I am using
the following code to add the fields to a temporary structure
(monthlycontact) before adding the structure to the session scope:

<cfloop collection="#request.terraform.fields#" item="i">
     <cfset monthlycontactdetails[i] = request.terraform.fields[i].rawvalue>
</cfloop>

I just want to check that I am using the 'rawvalue' variable correctly... I was 
using the following code:

<cfloop collection="#request.terraform.fields#" item="i">
     <cfset monthlycontactdetails[i] = request.terraform.fields[i].value>
</cfloop>

But experience problems when passing dates (might be because of locales?).
This is the error I was receiving when I tried to submit the form: "{ts 
&apos;2004-12-13 00:00:00&apos;}" is an invalid date format.

I got the following to work but it seemed like too much code...

<cfloop collection="#request.terraform.fields#" item="i">
     <cfset tempvalue = request.terraform.fields[i].value>
     <cfif IsDate(tempvalue)>
          <cfset monthlycontactdetails[i] = DateFormat(tempvalue,"dd/mm/yyyy")>
     <cfelse>
          <cfset monthlycontactdetails[i] = tempvalue>
     </cfif>
</cfloop>

That's when I stumbled across the 'rawvalue' variable.

So, is it alright to use that 'rawvalue' variable in this way? (ie. to get the 
raw text of the entered date?)

Thanks
- Malessa






=======================================================
The information contained in the above e-mail message or messages 
(which includes any attachments) is confidential and may be legally 
privileged.  It is intended only for the use of the person or entity 
to which it is addressed.  If you are not the addressee any form of 
disclosure, copying, modification, distribution or any action taken 
or omitted in reliance on the information is unauthorised.  Opinions 
contained in the message(s) do not necessarily reflect the opinions 
of the Queensland Government and its authorities.  If you received 
this communication in error, please notify the sender immediately and 
delete it from your computer system network.
=======================================================


Other related posts: