How to customize form validation errors in codeIgniter

前端 未结 8 2231
刺人心
刺人心 2021-01-05 07:18

Is there a file in codeIgniter in which I could just edit so that I can customize the form validation messages?

<script

相关标签:
8条回答
  • 2021-01-05 07:58

    You can change the Error Delimiters in this way:

    <ul>
    <?php echo validation_errors('<li>', '</li>'); ?>
    </ul>
    

    docs: https://www.codeigniter.com/user_guide/libraries/form_validation.html#changing-the-error-delimiters

    For v3: https://www.codeigniter.com/userguide3/libraries/form_validation.html#changing-the-error-delimiters

    0 讨论(0)
  • 2021-01-05 07:59

    You can use <?php echo form_error('field name', '<div class="error">', '</div>'); ?> for displaying errors individually.

    Documentation

    0 讨论(0)
提交回复
热议问题