![]() |
Why form validation automatically converts special HTML chars? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Why form validation automatically converts special HTML chars? (/showthread.php?tid=13049) |
Why form validation automatically converts special HTML chars? - El Forum - 11-09-2008 [eluser]Volder[/eluser] I created a simple controller test.php: Code: <?php and a simple view v_test.php: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" the question is the following: I don't use htmlspecialchars function in validation rules for my field - but why the function set_value() produces transformed special characters? So for example I inputed the value Code: <a href="http://test">test</a> Is there any way to leave it untouched in validation? Why form validation automatically converts special HTML chars? - El Forum - 11-09-2008 [eluser]Pascal Kriete[/eluser] Set_value calls form_prep (form helper) to prevent the html from breaking your form. If you don't want it to do that use $this->validation->set_value instead. Why form validation automatically converts special HTML chars? - El Forum - 11-09-2008 [eluser]Volder[/eluser] thanks a lot, using Code: $this->form_validation->set_value() |