The CreatorCon Call for Content is officially open! Get started here.

Grab info inputed into UI page tinymce field? ( medium easy points )

juan casas
Mega Expert

Grab info inputed into UI page tinymce field? 

 

this is the field that I have in my UI page::

    <script>
        tinymce.init({
        mode : "specific_textareas",
        editor_selector : "mce",
        width: '100%',
        height: '300px',

        menubar: "tools",
        toolbar: "$[gs.getProperty('glide.ui.html.editor.v4.toolbar.line1')]",
        content_css : "* {font: 10px arial, sans-serif;} b {font-weight:bold;} th {font-weight:bold;} strong {font-weight:bold;}",
        });
    </script>
<textarea cols="80" rows="10"  name="comment" id="comment"  class="mce"> ${jvar_emailbody} </textarea>

 

 

 

 

I tried to grab the value that the user inputed by using     var comment =  get('comment').value in the client script,

but that did not work

1 ACCEPTED SOLUTION

juan casas
Mega Expert

document.getElementById("comment").value was the anwes

View solution in original post

5 REPLIES 5

Mohith Devatte
Tera Sage
Tera Sage
<textarea cols="80" rows="10"  name="comment" id="comment" value =${jvar_emailbody} class="mce"> ${jvar_emailbody} </textarea>

Hello ,

 

please change it to above line and execute the same script in client script hope this helps Change your line to the above one And then try to execute the same script above to get the comment Hope this helps

I got an error.

The error went away after I put quotes ::  

value =${jvar_emailbody}        ======>   value ="${jvar_emailbody}"

 

I attached a screenshot

 

hello @juan casas  thanks for it ! 

Did it work in grabbing the input ?

If not please try this in client script 

window.parent.tinymce.get('contentID').getContent();

@juan casas  if it works please mark my answer correct 

 

😞

 

When I press the button nothing happens