jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Editor › jqxEditor problem, add special character at the end of text
Tagged: jQxEditor
This topic contains 3 replies, has 2 voices, and was last updated by ivailo 9 years, 10 months ago.
-
Author
-
Hi,
(I have a jQWidgets Developer License + Premium Support)
I have a problem in jqxEditor, when I add text for the first time, all appears ok and save in DB also ok, but when I open the record for editing, with the text/value in the textarea, the jqxEditor always add a DIV and a special character at the end of the original text.
“<div><div>
<div>{MSG_SAUDACAO} {bg_formandos_nome}
<br>
<br>Serve o presente para informar que o curso {bg_accoes_curso_id} terá inicio a {bg_accoes_data_inicio}.</div></div></div>”My code is:
<textarea id=”tpl_e_mensagem” name=”tpl_e_mensagem”><? echo $row_ficha[‘mensagem’]; ?></textarea>
$(‘#tpl_e_mensagem’).jqxEditor({
height: 300,
width: ‘100%’,
lineBreak: ‘div’,
tools: ‘campos | bold italic underline | font size | left center right | outdent indent | ul ol | link | clean | html’,
createCommand: function (name) {
switch (name) {
case “campos”:
return {
type: ‘list’,
tooltip: “Campos”,
init: function (widget) {
widget.jqxDropDownList({ placeHolder: “Campos”, width: 400, source: dataAdapter_tpl_e_field, displayMember: ‘nome’, valueMember: ‘nome’,autoDropDownHeight: false });
},
refresh: function (widget, style) {
// do something here when the selection is changed.
widget.jqxDropDownList(‘clearSelection’);
},
action: function (widget, editor) {
var widgetValue = widget.val();
// return object with command and value members.
return { command: “inserthtml”, value: widgetValue };
}
}}
}
});Please help me.
Hi bestcenter,
Probably it’s related to
lineBreak: 'div',
. So try to change it/ remove it.
If this doesn’t help check the value of$row_ficha['mensagem']
. Incorect value here also can produce that kind of behavior.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivailo,
thanks for the answer.
I remove de “lineBreak: ‘div'”, and remove “$row_ficha[‘mensagem’]”, now de textarea is empty, but still appears:
Hi bestcenter,
You also can get/set the value of the widget with the val method:
// Get the value. var value = $("#jqxEditor").jqxEditor('val'); // Get the value using jQuery's val() var value = $("#jqxEditor").val(); // Set value. $("#jqxEditor").jqxEditor('val', 'New Value'); // Set value using jQuery's val(). $("#jqxEditor").val('New Value');
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.