Save Multiple textareas with CKEditor 5
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I set CKEditor 5 to more than one , the editors all show up fine, but only the first one i can save on db.
I change the name of each textarea. The first one is line[0][descSoftware], the next is line[1][descSoftware], etc.
When i write var_dump($_POST); on form. The next array (descSoftware) doesn't bring me any string:
array(2) {
["nameSoftware"]=>
string(4) "Test"
["soft"]=>
array(2) {
[0]=>
array(3) {
["typeSoftware"]=>
string(4) "test"
["versionSoftware"]=>
string(1) "1"
["descSoftware"]=>
string(12) "
test1
"
}
[1]=>
array(3) {
["typeSoftware"]=>
string(5) "test2"
["versionSoftware"]=>
string(1) "2"
["descSoftware"]=>
string(0) ""
}
}
}
My view is php, i'm using Phalcon as a framework:
$formSoftwares .= $this->tag->tagHtmlClose('br');
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12']);
$formSoftwares .= $this->tag->tagHtml('h4', ['class' => 'box-title']);
$formSoftwares .= 'Versão Nº: ';
$formSoftwares .= $this->tag->tagHtml('span', ['class' => 'line']);
$formSoftwares .= $this->tag->tagHtmlClose('span');
$formSoftwares .= $this->tag->tagHtmlClose('h4');
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo tipo do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'typeSoftware']);
$formSoftwares .= 'Tipo de software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('typeSoftware',['name' => 'soft[0][typeSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo Versão do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'versionSoftware']);
$formSoftwares .= 'Versão do Software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('versionSoftware',['name' => 'soft[0][versionSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//botões add e remove
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('button',['style' => 'margin-top: 21px;font-size: 15px', 'type' => 'button', 'class' => 'btn btn-primary addSoftware', 'id' => 'addSoftware']);
//$formSoftwares .= '+';
$formSoftwares .= $this->tag->tagHtml('i', ['class' => 'fa fa-plus']);
$formSoftwares .= $this->tag->tagHtmlClose('i');
$formSoftwares .= $this->tag->tagHtmlClose('button');
$formSoftwares .= $this->tag->tagHtmlClose('div');
// Campo descrição
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12', 'style' => 'margin-top: 15px']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'descSoftware']);
$formSoftwares .= 'Descrição: ';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('descSoftware',['name' => 'soft[0][descSoftware]', 'require' => '']);
$formSoftwares .= $form->render('fileSoftware');
$this->view->formSoftwares = $formSoftwares;
Jquery, use to add a new row:
function addRow() {
$(document).on('click', '#addSoftware', function(){
var line = 0;
$('.line').each(function(i,v){
line = i + 1;
});
var html = $(this).parent().parent().html();
html = html.replace('primary', 'warning');
html = html.replace('plus', 'minus');
html = html.replace('addSoftware', 'removeSoftware');
html = html.replace(/soft[0]/g, 'soft['+line+']');
$('#addWrapper').append('<div = class="block">'+html+'</div>');
countRow();
//maskPayment();
removeRow();
});
}
Jquery, Ckeditor 5:
function getCkeditor() {
let editorDescricao = null;
ClassicEditor.create(document.querySelector(".descSoftware"), {
language: 'pt-br',
})
.then(editor => {
editorDescricao = editor;
})
.catch(console.error);
}
How can i proceed?
Thanks for help!
php jquery ckeditor phalcon
add a comment |
I set CKEditor 5 to more than one , the editors all show up fine, but only the first one i can save on db.
I change the name of each textarea. The first one is line[0][descSoftware], the next is line[1][descSoftware], etc.
When i write var_dump($_POST); on form. The next array (descSoftware) doesn't bring me any string:
array(2) {
["nameSoftware"]=>
string(4) "Test"
["soft"]=>
array(2) {
[0]=>
array(3) {
["typeSoftware"]=>
string(4) "test"
["versionSoftware"]=>
string(1) "1"
["descSoftware"]=>
string(12) "
test1
"
}
[1]=>
array(3) {
["typeSoftware"]=>
string(5) "test2"
["versionSoftware"]=>
string(1) "2"
["descSoftware"]=>
string(0) ""
}
}
}
My view is php, i'm using Phalcon as a framework:
$formSoftwares .= $this->tag->tagHtmlClose('br');
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12']);
$formSoftwares .= $this->tag->tagHtml('h4', ['class' => 'box-title']);
$formSoftwares .= 'Versão Nº: ';
$formSoftwares .= $this->tag->tagHtml('span', ['class' => 'line']);
$formSoftwares .= $this->tag->tagHtmlClose('span');
$formSoftwares .= $this->tag->tagHtmlClose('h4');
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo tipo do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'typeSoftware']);
$formSoftwares .= 'Tipo de software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('typeSoftware',['name' => 'soft[0][typeSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo Versão do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'versionSoftware']);
$formSoftwares .= 'Versão do Software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('versionSoftware',['name' => 'soft[0][versionSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//botões add e remove
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('button',['style' => 'margin-top: 21px;font-size: 15px', 'type' => 'button', 'class' => 'btn btn-primary addSoftware', 'id' => 'addSoftware']);
//$formSoftwares .= '+';
$formSoftwares .= $this->tag->tagHtml('i', ['class' => 'fa fa-plus']);
$formSoftwares .= $this->tag->tagHtmlClose('i');
$formSoftwares .= $this->tag->tagHtmlClose('button');
$formSoftwares .= $this->tag->tagHtmlClose('div');
// Campo descrição
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12', 'style' => 'margin-top: 15px']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'descSoftware']);
$formSoftwares .= 'Descrição: ';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('descSoftware',['name' => 'soft[0][descSoftware]', 'require' => '']);
$formSoftwares .= $form->render('fileSoftware');
$this->view->formSoftwares = $formSoftwares;
Jquery, use to add a new row:
function addRow() {
$(document).on('click', '#addSoftware', function(){
var line = 0;
$('.line').each(function(i,v){
line = i + 1;
});
var html = $(this).parent().parent().html();
html = html.replace('primary', 'warning');
html = html.replace('plus', 'minus');
html = html.replace('addSoftware', 'removeSoftware');
html = html.replace(/soft[0]/g, 'soft['+line+']');
$('#addWrapper').append('<div = class="block">'+html+'</div>');
countRow();
//maskPayment();
removeRow();
});
}
Jquery, Ckeditor 5:
function getCkeditor() {
let editorDescricao = null;
ClassicEditor.create(document.querySelector(".descSoftware"), {
language: 'pt-br',
})
.then(editor => {
editorDescricao = editor;
})
.catch(console.error);
}
How can i proceed?
Thanks for help!
php jquery ckeditor phalcon
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20
add a comment |
I set CKEditor 5 to more than one , the editors all show up fine, but only the first one i can save on db.
I change the name of each textarea. The first one is line[0][descSoftware], the next is line[1][descSoftware], etc.
When i write var_dump($_POST); on form. The next array (descSoftware) doesn't bring me any string:
array(2) {
["nameSoftware"]=>
string(4) "Test"
["soft"]=>
array(2) {
[0]=>
array(3) {
["typeSoftware"]=>
string(4) "test"
["versionSoftware"]=>
string(1) "1"
["descSoftware"]=>
string(12) "
test1
"
}
[1]=>
array(3) {
["typeSoftware"]=>
string(5) "test2"
["versionSoftware"]=>
string(1) "2"
["descSoftware"]=>
string(0) ""
}
}
}
My view is php, i'm using Phalcon as a framework:
$formSoftwares .= $this->tag->tagHtmlClose('br');
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12']);
$formSoftwares .= $this->tag->tagHtml('h4', ['class' => 'box-title']);
$formSoftwares .= 'Versão Nº: ';
$formSoftwares .= $this->tag->tagHtml('span', ['class' => 'line']);
$formSoftwares .= $this->tag->tagHtmlClose('span');
$formSoftwares .= $this->tag->tagHtmlClose('h4');
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo tipo do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'typeSoftware']);
$formSoftwares .= 'Tipo de software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('typeSoftware',['name' => 'soft[0][typeSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo Versão do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'versionSoftware']);
$formSoftwares .= 'Versão do Software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('versionSoftware',['name' => 'soft[0][versionSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//botões add e remove
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('button',['style' => 'margin-top: 21px;font-size: 15px', 'type' => 'button', 'class' => 'btn btn-primary addSoftware', 'id' => 'addSoftware']);
//$formSoftwares .= '+';
$formSoftwares .= $this->tag->tagHtml('i', ['class' => 'fa fa-plus']);
$formSoftwares .= $this->tag->tagHtmlClose('i');
$formSoftwares .= $this->tag->tagHtmlClose('button');
$formSoftwares .= $this->tag->tagHtmlClose('div');
// Campo descrição
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12', 'style' => 'margin-top: 15px']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'descSoftware']);
$formSoftwares .= 'Descrição: ';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('descSoftware',['name' => 'soft[0][descSoftware]', 'require' => '']);
$formSoftwares .= $form->render('fileSoftware');
$this->view->formSoftwares = $formSoftwares;
Jquery, use to add a new row:
function addRow() {
$(document).on('click', '#addSoftware', function(){
var line = 0;
$('.line').each(function(i,v){
line = i + 1;
});
var html = $(this).parent().parent().html();
html = html.replace('primary', 'warning');
html = html.replace('plus', 'minus');
html = html.replace('addSoftware', 'removeSoftware');
html = html.replace(/soft[0]/g, 'soft['+line+']');
$('#addWrapper').append('<div = class="block">'+html+'</div>');
countRow();
//maskPayment();
removeRow();
});
}
Jquery, Ckeditor 5:
function getCkeditor() {
let editorDescricao = null;
ClassicEditor.create(document.querySelector(".descSoftware"), {
language: 'pt-br',
})
.then(editor => {
editorDescricao = editor;
})
.catch(console.error);
}
How can i proceed?
Thanks for help!
php jquery ckeditor phalcon
I set CKEditor 5 to more than one , the editors all show up fine, but only the first one i can save on db.
I change the name of each textarea. The first one is line[0][descSoftware], the next is line[1][descSoftware], etc.
When i write var_dump($_POST); on form. The next array (descSoftware) doesn't bring me any string:
array(2) {
["nameSoftware"]=>
string(4) "Test"
["soft"]=>
array(2) {
[0]=>
array(3) {
["typeSoftware"]=>
string(4) "test"
["versionSoftware"]=>
string(1) "1"
["descSoftware"]=>
string(12) "
test1
"
}
[1]=>
array(3) {
["typeSoftware"]=>
string(5) "test2"
["versionSoftware"]=>
string(1) "2"
["descSoftware"]=>
string(0) ""
}
}
}
My view is php, i'm using Phalcon as a framework:
$formSoftwares .= $this->tag->tagHtmlClose('br');
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12']);
$formSoftwares .= $this->tag->tagHtml('h4', ['class' => 'box-title']);
$formSoftwares .= 'Versão Nº: ';
$formSoftwares .= $this->tag->tagHtml('span', ['class' => 'line']);
$formSoftwares .= $this->tag->tagHtmlClose('span');
$formSoftwares .= $this->tag->tagHtmlClose('h4');
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo tipo do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'typeSoftware']);
$formSoftwares .= 'Tipo de software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('typeSoftware',['name' => 'soft[0][typeSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//Campo Versão do software
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'versionSoftware']);
$formSoftwares .= 'Versão do Software:';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('versionSoftware',['name' => 'soft[0][versionSoftware]', 'require' => '']);
$formSoftwares .= $this->tag->tagHtmlClose('div');
//botões add e remove
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-4']);
$formSoftwares .= $this->tag->tagHtml('button',['style' => 'margin-top: 21px;font-size: 15px', 'type' => 'button', 'class' => 'btn btn-primary addSoftware', 'id' => 'addSoftware']);
//$formSoftwares .= '+';
$formSoftwares .= $this->tag->tagHtml('i', ['class' => 'fa fa-plus']);
$formSoftwares .= $this->tag->tagHtmlClose('i');
$formSoftwares .= $this->tag->tagHtmlClose('button');
$formSoftwares .= $this->tag->tagHtmlClose('div');
// Campo descrição
$formSoftwares .= $this->tag->tagHtml('div',['class' => 'col-xs-12', 'style' => 'margin-top: 15px']);
$formSoftwares .= $this->tag->tagHtml('label', ['for' => 'descSoftware']);
$formSoftwares .= 'Descrição: ';
$formSoftwares .= $this->tag->tagHtmlClose('label');
$formSoftwares .= $form->render('descSoftware',['name' => 'soft[0][descSoftware]', 'require' => '']);
$formSoftwares .= $form->render('fileSoftware');
$this->view->formSoftwares = $formSoftwares;
Jquery, use to add a new row:
function addRow() {
$(document).on('click', '#addSoftware', function(){
var line = 0;
$('.line').each(function(i,v){
line = i + 1;
});
var html = $(this).parent().parent().html();
html = html.replace('primary', 'warning');
html = html.replace('plus', 'minus');
html = html.replace('addSoftware', 'removeSoftware');
html = html.replace(/soft[0]/g, 'soft['+line+']');
$('#addWrapper').append('<div = class="block">'+html+'</div>');
countRow();
//maskPayment();
removeRow();
});
}
Jquery, Ckeditor 5:
function getCkeditor() {
let editorDescricao = null;
ClassicEditor.create(document.querySelector(".descSoftware"), {
language: 'pt-br',
})
.then(editor => {
editorDescricao = editor;
})
.catch(console.error);
}
How can i proceed?
Thanks for help!
php jquery ckeditor phalcon
php jquery ckeditor phalcon
edited Nov 19 '18 at 9:21
Arthur
asked Nov 16 '18 at 13:55
ArthurArthur
12
12
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20
add a comment |
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339260%2fsave-multiple-textareas-with-ckeditor-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339260%2fsave-multiple-textareas-with-ckeditor-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
share you html please.
– Oleg Nurutdinov
Nov 16 '18 at 14:01
Sorry, i add my code now.
– Arthur
Nov 19 '18 at 9:24
Share the page source after the form is rendered please.
– a_byte_late
Nov 22 '18 at 22:20