Welcome Guest, Not a member yet? Register   Sign In
Problem with form validation
#2

[eluser]Aniket Pant[/eluser]
And this is my view:
Code:
<?php include 'user/inc/header.php'; ?>

<div id="content" class="row twelvecol">
    <h1>Create Profile (Step 2 of 2)</h1>
    <h2>For &lt;?php echo $usertype; ?&gt;</h2>
    &lt;?php
        echo form_open('register/CreateProfile_Step2');
        if ($usertype == 'User') {
                echo form_label('Sex', 'sex');
                $options_sex = array(
                    'Male' => 'Male',
                    'Female' => 'Female'
                );
                echo form_dropdown('sex', $options_sex, 'male');
                $ctr = 1;
                echo form_label('Activities Interested In', 'activities');
                foreach($options->result() as $option)
                {
                    echo form_label($option->activity, 'activity-'.$ctr);
                    $arr_option = array(
                        'name'  => 'activities[]',
                        'id'    => 'activity-'.$ctr++,
                        'value' => $option->activity
                    );
                    echo form_checkbox($arr_option);
                }
        }
        elseif ($usertype == 'Gym/Health Club Owner')
        {
                echo form_label('Website', 'website');
                $arr_website = array(
                    'name' => 'website',
                    'id' => 'website',
                    'value' => set_value('website')
                );
                echo form_input($arr_website);
                echo form_label('Hours of Operation', 'hours_of_operation');
                $arr_hours = array(
                    'name' => 'hours_of_operation',
                    'id' => 'hours_of_operation',
                    'value' => set_value('hours_of_operation')
                );
                echo form_input($arr_hours);
                echo form_label('Membership Charges', 'membership_charges');
                $arr_charges = array(
                    'name' => 'membership_charges',
                    'id' => 'membership_charges',
                    'value' => set_value('membership_charges')
                );
                echo form_input($arr_charges);
                $ctr = 1;
                echo form_label('Facilities Available', 'facilities');
                foreach($options->result() as $option)
                {
                    echo form_label($option->facility, 'facility-'.$ctr);
                    $arr_option = array(
                        'name'  => 'facilities[]',
                        'id'    => 'facility-'.$ctr++,
                        'value' => $option->facility
                    );
                    echo form_checkbox($arr_option);
                }
        }
        echo "<br/><br/>";
        echo form_submit('submit', 'Create Profile');
        echo form_close();
        
        echo validation_errors();
    ?&gt;
    
    <a href="&lt;?php echo site_url(); ?&gt;/register/CreateProfile_Step1">Return to previous step</a>
    
</div>

&lt;?php include 'user/inc/footer.php'; ?&gt;


Messages In This Thread
Problem with form validation - by El Forum - 08-09-2011, 11:59 PM
Problem with form validation - by El Forum - 08-09-2011, 11:59 PM
Problem with form validation - by El Forum - 08-10-2011, 12:26 AM
Problem with form validation - by El Forum - 08-10-2011, 12:29 AM
Problem with form validation - by El Forum - 08-10-2011, 01:19 AM
Problem with form validation - by El Forum - 08-10-2011, 01:25 AM
Problem with form validation - by El Forum - 08-10-2011, 04:23 AM
Problem with form validation - by El Forum - 08-10-2011, 04:25 AM
Problem with form validation - by El Forum - 08-10-2011, 08:36 AM
Problem with form validation - by El Forum - 08-10-2011, 02:51 PM
Problem with form validation - by El Forum - 08-10-2011, 08:14 PM
Problem with form validation - by El Forum - 08-10-2011, 11:36 PM
Problem with form validation - by El Forum - 08-10-2011, 11:37 PM
Problem with form validation - by El Forum - 08-11-2011, 12:02 AM
Problem with form validation - by El Forum - 08-11-2011, 12:05 AM
Problem with form validation - by El Forum - 08-11-2011, 12:13 AM
Problem with form validation - by El Forum - 08-11-2011, 12:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB