Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfscript and javascript

Status
Not open for further replies.

fdgsogc

Vendor
Feb 26, 2004
160
CA
I have a cfscript from the common FCKeditor. See code below:

Code:
<form id="issueinsert" method="post" name="issueinsert" onSubmit="checkDescription();">
				<cfscript>
					fckEditor = createObject("component", "fckeditor/fckeditor");
					fckEditor.instanceName	= "issuedescription";
					fckEditor.value			= '';
					fckEditor.basePath		= "fckeditor/";
					fckEditor.width			= "100%";
					fckEditor.height		= 250;
					fckEditor.create(); // create the editor.
				</cfscript>

I am able to use the instance name of "issuedescription" when inserting the form element value into a database table. However, when I want to use javascript code like this to check the contents of the element before posting to the table for the word "color", this code cannot see the element.

Code:
	function checkDescription()
		{
		var x=document.issueinsert.issuedescription.value;
		var patt1=/color/i;
		alert(x)
		}

However, when testing this against a normal input text form element, there is no issue. Can someone shed some light on this?
 
Try the following:

Code:
var x = document.forms["myForm"]["issuedescription"].value;

ColdFusion Ninja for hire.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top