Welcome Guest, Not a member yet? Register   Sign In
Show name “corrupted” when validation fails
#1

I'm having this name field
PHP Code:
<?php echo form_label('Your Name <span class="required">*</span>''name', array('class' => 'col-sm-3 control-label')); ?>
                            <div class="col-sm-9">
                                <?php echo form_input('name'set_value('name'$this->input->post('name')), 'class="form-control"'); ?>
                                <?php echo form_error('name'); ?>
                            </div> 

and these are the validation rules

PHP Code:
$config = array(
            
'name' => array(
                
'field' => 'name',
                
'label' => 'Name',
                
'rules' => 'required|trim|min_length[2]',
            ),
        ); 

I've spotted an issue when trying to validate the field. If I type a name like Mc'Donalds and hot submit I get this from set_value()

Mc'Donalds

How can I fix this issue ?

I 've tried using htmlscecialcars_decode() and html_entity_decode() with ENT_QUOTES or ENT_COMPAT, but didn't do the trick
Reply


Messages In This Thread
Show name “corrupted” when validation fails - by Lykos22 - 11-09-2015, 05:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB