Php 如何显示文本编辑器值 提交 $(文档).ready(函数(){ $(“#txtEditor”).Editor(); });
在trmser.php上Php 如何显示文本编辑器值 提交 $(文档).ready(函数(){ $(“#txtEditor”).Editor(); });,php,html,Php,Html,在trmser.php上 <form id="staff_add" class="form-horizontal" action="trmser.php" method="post" autocomplete="off"> <textarea class="form-control input-sm" id="txtEditor" name="details" placeholder="Details"> <?php //echo $valu
<form id="staff_add" class="form-horizontal" action="trmser.php" method="post" autocomplete="off">
<textarea class="form-control input-sm" id="txtEditor" name="details" placeholder="Details">
<?php //echo $value['details'];?>
</textarea>
<button type="submit">Submit</button>
</form>
<script>
$(document).ready(function() {
$("#txtEditor").Editor();
});
</script>
表单上提交文本编辑器值不显示请帮帮我。我想您正在使用? 您需要添加document.submit部分以从编辑器读取数据并将其粘贴到文本区域。见下文:
<?php echo $_POST['details'];?>
$(文档).ready(函数(){
$(“#txtEditor”).Editor();
});
$(文档)。提交(函数(){
$(“#txtEditor”).val($(“#txtEditor”).Editor(“getText”));
});
重置
提交
要填写应用程序中的某些文本,您可以使用:
<head>
<!-- your other scripts like jquery & bootstrap -->
<script src="editor.js"></script>
<script>
$(document).ready(function() {
$("#txtEditor").Editor();
});
$(document).submit(function(){
$("#txtEditor").val($("#txtEditor").Editor("getText"));
});
</script>
</head>
<body>
<form action="myscript.php" method="post">
<textarea class="form-control input-sm" id="txtEditor" name="details" placeholder="Details">
</textarea>
<button type="reset">Reset</button>
<button type="submit">Submit</button>
</form>
<?php echo $value['details'];?>
</body>
$(文档).ready(函数(){
$(“#txtEditor”).Editor();
$(“#txtEditor”).Editor(“setText”,);
});
注意,
和
之间的换行符和空格也将显示在一些/所有浏览器上,即Google Chrome和其他浏览器上。表单标记或post方法在哪里?你觉得不发布db代码是不相关的吗?无论哪种方式,检查错误和控制台。现在我也很好奇:)我更新了答案-让我知道它是否工作感谢它的工作,但另一个问题是更新时间获取的数据没有显示在文本区域中。请更新投票将其标记为已回答:)-您可以使用$(“#txtEditor”)。编辑器(“setText”,“foo”)
我会这样做,但这里有一些html标签请看一看-这是您面临的同一问题吗?
$(document).ready(function() {
$("#txtEditor").Editor();
$("#txtEditor").Editor("setText", <?php echo $value['details'];?>);
});