You need to sign in to do that
Don't have an account?

Problem on Textarea while get the content information in textarea using javascript
Hi All,
I am try to get the content body information of the textarea using javascript or jquery.
<apex:inputTextarea value="{!event_badge__c.Name_Badge_Body__c}" id="event_badge_text" styleClass="event_badge_text" richText="true"/>
am using richText="true" didnt get any information using javascript.
var con = document.getElementById("j_id0:event_from:j_id5:j_id13:event_badge_text___Frame").contentWindow.document.body.innerHTML; alert(con);
using this code only get first iframe content but i didnt get the content inforamtion of the textarea.
if any one have anu idea about this issue why its happening?
Thanks & Regards
Feroz
var con = document.getElementById("j_id0:event_from:j_id5:j_id13:event_badge_text___Frame").contentWindow.document.body.innerHTML; alert(con);
first thing you need to check Ids caz most of the ids are generated at runtime. Give the IDs munually to all the section.
It should be allowed by using simple var con= document.getElementById('someId').value;
ThanQ for Reaply,
if am not using the attribute richText="true" your solution is correct but am using the attribute richText="true" they seems problem.
the richText editor have contain two iFrames means <iframes id="someid"><table><tr></tr><tr><td id="something"><iframe></iframe></td></tr></table></iframes>
am trying to get the content of the iframe using iframe id
like as
var con = $("someid").contents().html();
alert(con);
it should display hole content of the iframe like as <table></table>
in the content body it have another iframe.
am trying to get the information of the inner iframe using this code it should be null.
var con = $("iframe").contents().find("iframe").html(); or $("iframe").contents().find("inner td some id").html();
alert(con);
it should be given an null value;
Thanks & Regards
Feroz
Try using the $Component global variable..
Thanks for reaply,
am using the $Component global variable.
it should be display null value;
but getting same thing null value.
am using the $Component global variable.
it is display null value;
<apex:inputTextarea richtext="true" id="richtextcomp"> </apex:inputTextarea>
<apex:image url="{!$Resource.loadingimage}" onclick="switchMenu('{!$Component.richtextcomp}')"></apex:image> <script> function switchMenu(a) {
alert(a);
alert(document.getElementById(a).value);
alert(document.getElementById(a).innerHTML);
} </script>
plz give any idea about this.
Thanks & Regards
Feroz khan
Hi all,
am getting alternate solution of the richtextarea using dojo richtext
am using this code working fine but am facing brower compability .
it is working on Firefox browser. but not working on chrome browser.
what is the problem if any idea.
Thanks & Regards
FerozKhan
Check if there are any java script errors.
Check if you are getting proper ids or not ,document.getElementById('{!$Component.descript}').
Thanks for reaply
am doing same thing and get the proper id.but gettting null value.
Try using niceEdit text area free editor.....it will resolve all ur issues.....