Copy link to clipboard
Copied
I am wondering if there is any way to pass the data of a cftextarea within a flash form to a javascript function on the same page? I am trying to implement a spell checking feature onto a flash form. I am sure that my spell checking code works, as it correctly spell checks when I am in a non-flash cfform area.
I have tried linking the javascript function to the form info through this convention:
document.form.TextAreaName
Unfortunately I have had no success. Any help on this issue would be very much appreciated.
Thanks,
AeroNicko
Copy link to clipboard
Copied
Ok, so I am pretty sure my problem is being caused by me not passing the flash variable of the cftextarea correctly within my getURL link to the Javascript.
Here is what I am doing:
In the head of my .cfm file, I set up the javascript to create the spell check pop up window and pass the text to be edited.
<!--- Code to set up call to Spell Checker (Javascript) (NAB 8/27/09) --->
<script src="../Spellchecking/spellerpages-0.5.1/speller/spellChecker.js" language="javascript"></script>
<script language="javascript" type="text/javascript">
function openSpellChecker() {
// get the textarea we're going to check
var txt = document.activity.Summary;
// give the spellChecker object a reference to our textarea
// pass any number of text objects as arguments to the constructor:
var speller = new spellChecker( txt );
// kick it off
speller.openChecker();
}
</script>
Within my flash cfform (named activity), I set up my text area:
<cftextarea name="Summary" id="Summary" maxlength="1000" tooltip="Summarize your entry here. The field has a 1000 character limit. This summary is included in the generated End of the Week reports." onChange="submitTemporary('Summary', Summary.text);requiredContent('summary');" onFocus="if(detailsBox.height>60){detailsBox.height=60;summaryBox.height=220;}"></cftextarea>
And then I create a button that handles the calling of the javascript function:
<cfinput type="button" style="#buttonstyle#" name="SpellCheck" value="Spell Check" onClick="getURL('javascript:openSpellChecker();')">
When I click on the button, I know that the javascript is working, as it pops up the spell checker window. After the window pops up though, it hangs and acts like nothing is being passed to it.
On the site I found the method of calling a javascript function in a flash form, they said something about passing any form variables within the getURL function call. How would I do that? I have tried passing document.form.name, but have had no success.
Once again, THANK YOU soo much for any guidance!
Site I got linking info from:
http://blog.codefidelity.com/?p=15