Welcome Guest, Not a member yet? Register   Sign In
Trying to apply a function to form validation set_value [SOLVED, with thanks!]
#4

[eluser]nuwanda[/eluser]
Thanks, stormbytes.

I assume you were suggesting I apply that to my validation rule, thus:

Code:
$this->form_validation->set_rules('link_description','link_desription','trim|strip_newlines);

then

Code:
function strip_newlines($field_name){
  return preg_replace ('/\r\n|\r|\n/', ' ',$field_name);
}

But, no, didn't help. The set_value still returned the text with breaks in the view. It didn't throw an error so it got processed. Weird. I thought it might work like trim does.


Messages In This Thread
Trying to apply a function to form validation set_value [SOLVED, with thanks!] - by El Forum - 11-17-2010, 01:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB