Welcome Guest, Not a member yet? Register   Sign In
triming on data submitting
#3

You are always going to have to trim data to remove whitespace in text fields (if whitespace is a problem). Even if you do it with JS browser side, you will still have to check and remove it server side too. So you are always going to need a trim function of some sort.

PHP's trim function,
Code:
trim($string);
http://php.net/manual/en/function.trim.php

Jquery's trim function
Code:
$.trim(string);
https://api.jquery.com/jQuery.trim/

Javascript trim function
Code:
string.trim()
http://www.w3schools.com/jsref/jsref_trim_string.asp

The 'trim' in the form validation is just applying the native php's trim function. You can set any php function with just one argument to a validation check in CI. https://www.codeigniter.com/user_guide/l...pping-data
Reply


Messages In This Thread
triming on data submitting - by mstdmstd - 01-07-2017, 02:21 AM
RE: triming on data submitting - by gaska96 - 01-07-2017, 08:22 AM
RE: triming on data submitting - by PaulD - 01-07-2017, 10:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB