function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mackendw@gmail.commackendw@gmail.com 

Problem posting variable from Javascript YUI simpleeditor into visualforce form field

Hi:

 

   I'm using the Yahoo YUI toolkit simpleeditor component to capture via a pop-up window some remarks info.

 

   I have a button and associated inputTextArea field on the main page that holds the data field for the remark.  This is backed by a field with getter/setter methods in the controller class.

 

   In the pop-up page which uses YUI simpleeditor, the page renders fine and captures the rich text fine.  I attempt to post the contents that the editor collects using the following javascript function:

 

    function beforeTextSave()
    {
       var rem=myEditor.getEditorHTML();
       document.getElementById('{!$Component.remarksId}').value = rem;
    }

 

   I put an alert statement after the document to ensure it was capturing the data from simpleeditor OK and it was.

 

   The remarksId id refers to:

 

<div class="yui-skin-sam" style="display:none" id="editor" align="center" ><p />
    <apex:commandButton value="Save"  onclick="beforeTextSave();CloseWindow();"/>
 <apex:inputtextarea id="remarksId" rows="20" cols="75" value="{!remarks}" richText="true"/>

 

   What am I doing incorrectly here?  Should not the javascript be posting the updated editor data into the remarks field by virtue of me updating the component on the page by its ID.value?

 

thoughts??

 

Best Answer chosen by Admin (Salesforce Developers) 
mackendw@gmail.commackendw@gmail.com

Found a much better - all visualforce solution.

 

http://www.tehnrd.com/visualforce-pop-up/

All Answers

STest123STest123

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

mackendw@gmail.commackendw@gmail.com

Found a much better - all visualforce solution.

 

http://www.tehnrd.com/visualforce-pop-up/

This was selected as the best answer