Welcome Guest, Not a member yet? Register   Sign In
What in the world?!?!
#1

[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">
                &lt;?=form_error('real')?&gt;
                &lt;?=form_error('email')?&gt;
                &lt;?=form_error('password')?&gt;
                &lt;?=form_error('confirm')?&gt;
                &lt;?=form_error('age')?&gt;
                &lt;?=form_error('zipcode')?&gt;
                &lt;?=form_error('gender')?&gt;
                &lt;?php if(isset($status)):?&gt;
                    &lt;?=$status?&gt;
                &lt;?php endif; ?&gt;
            </div>
                &lt;?php $options = array('18' => 'Under 18', '25' => '18-25', '35' => '25-35', '45' => '35-45', '55' => '55+'); ?&gt;
                &lt;?=form_open('mobile/registration')?&gt;
                &lt;?=form_label('Real Name: ', 'real')?&gt;
                <br />
                &lt;input type="text" name="real" id="real" class="field" value="&lt;?=set_value('real')?&gt;" /&gt;
                <br />
                &lt;?=form_label('E-mail: ', 'email')?&gt;
                <br />
                &lt;input type="text" name="email" id="email" class="field" value="&lt;?=set_value('email')?&gt;" /&gt;
                <br />
                &lt;?=form_label('Password: ')?&gt;
                <br />
                &lt;input type="password" name="password" id="password" class="field" /&gt;
                <br />
                &lt;?=form_label('Confirm Password: ')?&gt;
                <br />
                &lt;input type="password" name="confirm" id="confirm" class="field" /&gt;
                <br />
                &lt;?=form_label('Age: ', 'age')?&gt;
                <br />
                &lt;?=form_dropdown('age', $options, '', 'id="age" class="field"')?&gt;
                <br />
                &lt;?=form_label('Zipcode: ', 'zipcode')?&gt;
                <br />
                &lt;input type="text" name="zipcode" id="zipcode" class="field" /&gt;
                <br />
                &lt;?=form_label('Gender: ', 'gender')?&gt;
                <br />
                &lt;?=form_radio(array('name' => 'gender', 'id' => 'gender', 'value' => 'male', 'checked' => 'TRUE'))?&gt; <font color="#6F7072">Male</font>
                <br />
                &lt;?=form_radio(array('name' => 'gender', 'id' => 'gender', 'value' => 'female'))?&gt; <font color="#6F7072">Female</font>
                <br />
                &lt;input id="register" type="submit" value="Register!"&gt; or <a href="/pinpointme">Log in</a>
                &lt;?=form_close()?&gt;
            </div>

Code:
array(
                                                                                
                                                                                            'field' => 'real',
                                                                                            'label' => 'Real Name',
                                                                                            'rules' => 'required'
                                                                                
                                                                                )
#2

[eluser]baudday[/eluser]
Okay I figured it out. I'm really sorry for wasting your time. I wasn't passing the fields through the jQuery function




Theme © iAndrew 2016 - Forum software by © MyBB