PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 14, 2022

[FIXED] Codeigniter with Summernote - Validation Issue

 March 14, 2022     codeigniter, php, required, summernote, validation     No comments   

Issue

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!


Solution

Make sure you put this before the form_validation->run() statement

if($this->input->post("textfield")=="<p><br></p>"){
    $this->input->post("textfield")="";
}


Answered By - EdL
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing