admin管理员组文章数量:1293566
This is how my form looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ".dtd">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>צור כתבה</title>
<script type="text/javascript" src="tiny_mce/jquery.js"></script>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_toolbar_location : "top",
height:"1000px",
width:"800px",
editor_selector :"mceEditor"
});
tinyMCE.activeEditor.getContent();
</script>
</head>
<body>
<div align="center" id="htmlEditor">
<form >
<table>
<tr>
<td>
<textarea name="textareas" cols="40" rows="20" class="mceEditor"></textarea>
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="צור מאמר"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
When the form is posted, I want to fetch the data that is inside the textarea as it is and put it into the database.
The question is how do I do it, considering that I use php and $_POST..
I know that there is that function: tinyMCE.activeEditor.getContent();
But it is a javascript function. How do I fetch the data from that javascript function and put into my php code so that I will be able to use it to put into my database?!?!?
This is how my form looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>צור כתבה</title>
<script type="text/javascript" src="tiny_mce/jquery.js"></script>
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_toolbar_location : "top",
height:"1000px",
width:"800px",
editor_selector :"mceEditor"
});
tinyMCE.activeEditor.getContent();
</script>
</head>
<body>
<div align="center" id="htmlEditor">
<form >
<table>
<tr>
<td>
<textarea name="textareas" cols="40" rows="20" class="mceEditor"></textarea>
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="צור מאמר"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
When the form is posted, I want to fetch the data that is inside the textarea as it is and put it into the database.
The question is how do I do it, considering that I use php and $_POST..
I know that there is that function: tinyMCE.activeEditor.getContent();
But it is a javascript function. How do I fetch the data from that javascript function and put into my php code so that I will be able to use it to put into my database?!?!?
Share Improve this question edited Jul 5, 2016 at 5:16 moped 2,2472 gold badges26 silver badges31 bronze badges asked Oct 12, 2011 at 10:50 Dmitry MakovetskiydDmitry Makovetskiyd 7,05333 gold badges102 silver badges160 bronze badges3 Answers
Reset to default 3In your case you have to get it using $_POST['textareas']
because 'textareas' is the name
of the textarea.
The function tinyMCE.activeEditor.getContent()
is client side, so you can get the content while you are on the page (before the submit).
Anyway as Amila said, you should add the method="post"
to your form.
add form method as post
<form method="post" action="" >
now you can get the textarea value by $_POST['textareas'];
yes by using post method you will get the value of your input element and for the tinyMice the name of the element to which you have created the instance
of the tinyMice
in your case it's textares
本文标签: javascriptHow do you get the content from Tinymce when the form is postedStack Overflow
版权声明:本文标题:javascript - How do you get the content from Tinymce when the form is posted? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741567457a2385809.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论