this EDITABLE DIV is in my web form[ADD/EDIT] - how get POST data FROM THIS ? FORM SU |
<div style="height: 600px; overflow-y: scroll; overflow-x:hidden;" class='col-md-12 sol-sm-12' contenteditable='true' id='user_notes_for_video' name='user_notes_for_video'></div>
can you help? this EDITABLE DIV is in my web form[ADD/EDIT] - how get POST data FROM THIS ? FORM SUBMITTED AS post REQUEST... NORMALLY FOR TEXT AREA I HAD IN THE CONTROLLER - Now what must be done ? 'user_notes_for_video' => $this->input->post('user_notes_for_video') Also in HTML5 - how limit in this writable DIV the characters and html data pictures etc to 1200 chars???
06-26-2018, 07:24 AM
(This post was last modified: 06-26-2018, 07:27 AM by qury. Edit Reason: updated response )
You can use jquery to get the text from the div and submit that using ajax.
PHP Code: $('#yourformid').on('submit', function (el) { As for editing the data, you can do that in form validation in your controller like this: PHP Code: $this->form_validation->set_rules('notes', 'User Notes', 'max_length[1200]');
Other way is create a hidden text field ... and put a jQuery when change div area change hidden field to be the same - in other words div editable ==hidden and submit hidden field normally as $this->input->post('user_notes_for_video') ... this can work???
(06-26-2018, 08:41 AM)lsepolis123 Wrote: Other way is create a hidden text field ... and put a jQuery when change div area change hidden field to be the same - in other words div editable ==hidden and submit hidden field normally as $this->input->post('user_notes_for_video') ... this can work??? also div have any max length css attr .. ? so as when filled up 1200 chars Can Not write anything in div editable??? |
Welcome Guest, Not a member yet? Register Sign In |