suyati / line-control

A Light Weight HTML5 Text Editor designed as a JQuery Plugin
Other
124 stars 90 forks source link

How to get the values to PHP? #93

Open lucianopopo opened 6 years ago

lucianopopo commented 6 years ago

I can´t get the values from the editor to PHP.

in html:

my script:

In my PHP Controller: public function createAction(){ $texto = $_POST['servico_texto']; $servico = new Servico(); if($servico->save( $texto)){ View::renderTemplate('Servicos/cadSucesso.html'); } else { View::renderTemplate('Servicos/cadServicos.html', [ 'servico' => $servico ]); } }

I know about this: $("#placeHolder").Editor("getText"); But I don´t know how to use it.

Someone please help me!!!!!!!!!!!!!!!!!

nmohanan commented 6 years ago

Hi can you try this below code

On Tue, Dec 19, 2017 at 11:25 PM, lucianopopo notifications@github.com wrote:

I can´t get the values from the editor to PHP.

in html:

my script:

In my PHP Controller: public function createAction(){ $texto = $_POST['servico_texto']; $servico = new Servico(); if($servico->save( $texto)){ View::renderTemplate('Servicos/cadSucesso.html'); } else { View::renderTemplate('Servicos/cadServicos.html', [ 'servico' => $servico ]); } }

I know about this: $("#placeHolder").Editor("getText"); But I don´t know how to use it.

Someone please help me!!!!!!!!!!!!!!!!!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/suyati/line-control/issues/93, or mute the thread https://github.com/notifications/unsubscribe-auth/AD_FuEcvdSftkoXjXSQjV6LMyVRCcyDUks5tB_ipgaJpZM4RHVhh .

--

Disclaimer: The information in this message may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete the message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Any information in this message that does not relate to official business shall be understood to be neither given nor endorsed by Suyati Technologies Private Limited. Although the company has taken reasonable precaution to ensure no viruses are present in this email, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

P Please consider the environment before printing this e-mail -- SAVE PAPER! SAVE THE PLANET!!

xOneca commented 6 years ago

Please, see #34: The editor doesn't automatically fill the textarea for you, you have to do it by hand before the form submit using something like this.

$('#txtEditor').text($('#txtEditor').Editor("getText"));

Please, don't skip over Editor's API like @nmohanan suggests, because it doesn't work if internal div structure changes (e.g. when the editor is in "view source" mode).

msnitish commented 3 years ago

@xOneca What is this "view source" mode ? Where do I read more about it ? I am working on adding a new function inside editor.js but the browser does not even show this new function in the editor.js viewable in the sources tab in chrome developer tools. My end goal is to detect the event changes in the textarea to which the editor is attached. If the content is null, then, I want to show red border around it. Simple validation.