Solved

Could u pls tell me the right syntex?

Posted on 2000-02-17
3
128 Views
Last Modified: 2013-12-24
I have a form with some fields. Now I want to store all the fields data to be store in a single variable. What I have done is patesd below:

<!-- Form.html -->

<form name="data" action="FormAction.cfm" method="Post">
      Name : <input type="Text" name="Name"> <br>
      Phone : <input type="Text" name="PhoneNo"> <br>
      <input type="Submit" name="Submit"> <br>
</form>

<!-- FormAction.cfm -->

<cfoutput>
      <cfset Data=
      <cfif isDefined("Form.Name")>"#Name# </cfif>
      <cfif isDefined("Form.PhoneNo")>#PhoneNo# </cfif> >
</cfoutput>

<cfoutput>
      #Data#
</cfoutput>

I am getting following error:
~~~~~~~~~
Error Occurred While Processing Request
Error Diagnostic Information
Just in time compilation error

Invalid token found on line 5 at position 2. Cold Fusion was looking at the following text:

<c
The last successfully parsed CFML construct was a CFSET tag occupying document position (4:2) to (4:7).

The specific sequence of files included or processed is:
C:\WEBSHARE\WWWROOT\training\FormAction.cfm      


Date/Time: 02/18/00 11:24:59
Browser: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Remote Address: 127.0.0.1
HTTP Referer: http://127.0.0.1/training/temp.htm
Template: C:\WEBSHARE\WWWROOT\training\FormAction.cfm
~~~~~~~

Can anybody help me out of this problem?

RAjesh

0
Comment
Question by:rkchopra
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 100 total points
ID: 2534310
<cfoutput>
<cfset Data=
<cfif isDefined("Form.Name")>'#form.Name#' </cfif>
<cfif isDefined("Form.PhoneNo")>#PhoneNo# </cfif> > 
</cfoutput>
check this you put extra " after fist if condition
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2534345
try this I check it it work fine
<cfoutput>
<cfset data="">
<cfif isDefined("Form.Name")>
<cfset data=listappend(data,"dsfsd")>
 </cfif>
 <cfif isDefined("Form.Phone")>
 <cfset data=listappend(data,'#form.phone#')>
 </cfif>
</cfoutput>
<cfoutput>#data#</cfoutput>
0
 

Author Comment

by:rkchopra
ID: 2534608
The second once works fine. Thankyou very much. I am giving you 100 no.

Regards,
RAjesh
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WSUS Client Issues 52 2,012
how to enable php7 module in nginx configuration file 8 460
Coldfusion Datefield problem 2 121
Ways to assess https/ssl websites 3 103
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question