I have the following code snippets which basically set a hidden field's value to the html content of a div (using jQuery) so I can process it on a backing bean:
MyPage.xhtml
function save_to_hidden()
{
document.getElementById('hidden_field').value=$('#my_div').html();
}
Further down:
<h:inputHidden id="hidden_field" value="#{myBean.divData}" />
Further down:
`<div id="my_div">
<!-- content in foreign language (spanish) -->
</div>
Further down:
<a4j:commandButton value="Save" onclick="save_to_hidden()" action="#{myBean.processDivData}" />
I receive the content on the "processDivData" method, but all the "special" characters are replaced with gibberish. Where the problem could be?
Thank you