I am using railo and attempting to submit a tinymce text area via ajax.
My problem is upon submission it seems that the html is stripped and the sql isn’t actually updated.
here is my code:
function UpdateHome() {
document.getElementById('UpdateProcessing').style.display = '';
document.getElementById('HomeForm').style.display = 'none';
ColdFusion.Ajax.submitForm("HomeForm","action.cfm",HomeUpdateReturn);
}
<form action="action.cfm" method="post" id="HomeForm">
<input type="hidden" name="action" value="HomeUpdate" />
<CFLOOP QUERY="FetchHome">
<textarea id="HomeArea" name="HomeArea" class="tinymce" rows="20" cols="20"
style="width:100%; height:500px" >#Body#</textarea>
</CFLOOP>
<input type="button" class="HomeSubmit" value="Save" onClick="UpdateHome();" />
</form>
<CFQUERY NAME="UpdateHome">
UPDATE Content
SET Body = '#HomeArea#'
WHERE ID = 1
</CFQUERY>
<CFSET UdateHome = ArrayNew(1)>
<CFSET UpdateHome[1] = true>
<CFCONTENT TYPE="application/json" RESET="true">
<CFOUTPUT>#serializeJSON(UpdateHome)#</CFOUTPUT>
When I submit the form without ajax the sql works fine .
does anyone have any idea why this wont submit the html formatted text via ajax?
All you need to do before you submit the form is to call the javascript line