I have a cfscript from the common FCKeditor. See code below:
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.
However, when testing this against a normal input text form element, there is no issue. Can someone shed some light on this?
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?