Codeigniter with Summernote - Validation Issue
-
21-12-2019 - |
Pregunta
I'm using Summernote with Codeigniter and loving it so far. But I do have one issue, I'm trying to make the text area required. But, even when you do not enter anything in the text field it still passes because Summernote automatically adds the following:
<p><br></p>
How do I get rid of this? I just need the required validation to work!
Thanks!
Solución
Make sure you put this before the form_validation->run()
statement
if($this->input->post("textfield")=="<p><br></p>"){
$this->input->post("textfield")="";
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow