[eluser]baudday[/eluser]
I am absolutely dumb founded right now. I am doing a basic registration form and everything was going smoothly. Then I try to validate a name field and it all just fell apart for me. I made the "real" field required. When I enter something and submit the form, it doesn't recognize that I entered anything into the field and throws the error that the field is required. Also, set_value() doesn't return anything for it. It's only for that field and I have no idea why it's doing it. I'm including the form and form_validation.php. It's just a basic validation, so the controller should be inconsequential.
Code:
<div id="form">
<img src="/pinpointme/images/logo.png" width="100%"/>
<h1>Register With Pinpoint Me!</h1>
<div id="status">
<?=form_error('real')?>
<?=form_error('email')?>
<?=form_error('password')?>
<?=form_error('confirm')?>
<?=form_error('age')?>
<?=form_error('zipcode')?>
<?=form_error('gender')?>
<?php if(isset($status)):?>
<?=$status?>
<?php endif; ?>
</div>
<?php $options = array('18' => 'Under 18', '25' => '18-25', '35' => '25-35', '45' => '35-45', '55' => '55+'); ?>
<?=form_open('mobile/registration')?>
<?=form_label('Real Name: ', 'real')?>
<br />
<input type="text" name="real" id="real" class="field" value="<?=set_value('real')?>" />
<br />
<?=form_label('E-mail: ', 'email')?>
<br />
<input type="text" name="email" id="email" class="field" value="<?=set_value('email')?>" />
<br />
<?=form_label('Password: ')?>
<br />
<input type="password" name="password" id="password" class="field" />
<br />
<?=form_label('Confirm Password: ')?>
<br />
<input type="password" name="confirm" id="confirm" class="field" />
<br />
<?=form_label('Age: ', 'age')?>
<br />
<?=form_dropdown('age', $options, '', 'id="age" class="field"')?>
<br />
<?=form_label('Zipcode: ', 'zipcode')?>
<br />
<input type="text" name="zipcode" id="zipcode" class="field" />
<br />
<?=form_label('Gender: ', 'gender')?>
<br />
<?=form_radio(array('name' => 'gender', 'id' => 'gender', 'value' => 'male', 'checked' => 'TRUE'))?> <font color="#6F7072">Male</font>
<br />
<?=form_radio(array('name' => 'gender', 'id' => 'gender', 'value' => 'female'))?> <font color="#6F7072">Female</font>
<br />
<input id="register" type="submit" value="Register!"> or <a href="/pinpointme">Log in</a>
<?=form_close()?>
</div>
Code:
array(
'field' => 'real',
'label' => 'Real Name',
'rules' => 'required'
)