Forum: Ruby on Rails problem in using tinymce editor

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Veera S. (Guest)
on 2007-04-30 19:15
Hello everybody,

I have a problem in using tinymce editor. I successfully I loaded the
tinymce as follows ;

<%= javascript_include_tag :defaults %>

<script language="javascript" type="text/javascript"
src="/javascripts/controls.js"></script>

<script language="javascript" type="text/javascript">
tinyMCE.init({
  mode : "textareas",
});


function submit_on_enter(e)

{

  var key;



  if(window.event)

    key = window.event.keyCode;

  else

    key = e.which



  if(key == 13){

    sendmsg();

    $('msg').value='';

  }



  return(false);

}
</script>

// And textarea like

<form method="post" action="/chat/post/<%= @user.id %>"
onSubmit="sendmsg(); return false;" id="msgform" name="msgform">


<textarea name="msg" id='msg' style="width: 400; height: 200;"
onKeyPress="submit_on_enter(event)">TinyMCE.</textarea>

</form>


Here the problem I faced as follows :

1. I can simply type the text. But I dont know how to get the textarea
value. Because here I want to save the content of the textarea into
mysql table when the press the enter key. But I didn't work.

2. I used a function " onKeyPress="submit_on_enter(event)" for the above
work. But Its didn't work.

Can any one clarify my doubts. Please.


Thanks in advance,

Regards,
Veeraa.
This topic is locked and can not be replied to.