Solved

Could u pls tell me the right syntex?

Posted on 2000-02-17
3
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reverse Proxy Server 6 96
How to switch email hosts (part 2) 11 71
Website being blocked? 3 136
wordpress email form 23 85
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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