CodeIgniter Forums

Full Version: Form validation - i18n input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


I've a problem with my form validation rules. The '.' and ',' can be my decimal seperator! The user must be able to enter a decimal number in both formats (e.g. 999.99 or 999,99).

My validation rules contain something like:
$config = array(
  'member/order' => array(
      'field' => 'amount',
      'label' => 'Amount',
      'rules' => 'decimal'

999.99 validates,
999,99 isn't validated with the above code fragment.

What is the best way to solve this problem?

El Forum

You can create a custom callback.