never read about StructKeyExists! dont know what books i am working from but i think the need updating.
seems like a better way and if there is lot going on then am sure it could help with speed, right?
again thanks
Main Topics
Browse All Topicsok i am trying to get the values from the form by using FORM.myEditor after submit (posted to same page). but all i get is a error: Element MYEDITOR is undefined in FORM! Now i know that when the page loads FORM.myEditor is not definded so thats why i used the bottom if statement to check it if was definded. but i still get the error and can not get the values from FORM.myEditor?
then with below when i then click submit i get this error
Parameter 1 of function IsDefined, which is now "This is some sample text. You are using FCKeditor.", must be a syntactically valid variable name.
full code below --------------------------
<form method="POST" action="#cgi.script_name#"
<cfscript>
basePath = "";
fckEditor = createObject("component", "#basePath#fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.value = 'This is some sample text. You are using <a href="http://fckeditor.net
fckEditor.basePath = basePath;
fckEditor.width = "100%";
fckEditor.height = 300;
fckEditor.create(); // create the editor.
</cfscript>
<br />
<input type="submit" value="Submit">
<br />
<cfdump var="#FORM#" label="Dump of FORM Variables">
</form>
<cfif IsDefined(#FORM.myEditor#)
<cfoutput>#FORM.myEditor#<
</cfif>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: Mr_NilPosted on 2006-01-06 at 02:19:18ID: 15627385
<cfif IsDefined(#FORM.myEditor#) > /cfoutput>
.
itor"). This will check for your variables in this one location, rather than working through every variables scope including FORM to check if your variable is defined.
itor")> /cfoutput>
<cfoutput>#FORM.myEditor#<
</cfif>
You've got your IsDefined wrong. It should be IsDefined("form.myEditor")
What you're doing is outputing the contents of the variable form.myeditor into the IsDefined() function, so that when coldfusion process the isdefined it tries to do :
<cfif IsDefined(This is some sample text. You are using FCKeditor.)>
If you are using CFMX 6 or 7, it is now more appropriate and more efficient to use StructKeyExists() rather than IsDefined(). All variable scopes are now structures and are always defined, so you can do StructKeyExists(FORM,"myEd
You cfif would look like this :
<cfif StructKeyExists(FORM,"MyEd
<cfoutput>#form.myeditor#<
</cfif>
Stephen