Welcome Guest, Not a member yet? Register   Sign In
is this a crazy view for a contact form
#1

[eluser]dsims[/eluser]
Code:
<?php
echo $this->validation->error_string;
$attributes = array(
    'class'       => 'contact'
    );
echo form_open('contact',$attributes);
$this->table->set_heading('','Contact Form');
$data = array(
    'name'        => 'fname',
    'id'          => 'fname',
    'value'       => '',
    'maxlength'   => '20'
     );
$this->table->add_row('<label for="fname">First Name:</label>', form_input($data), '* required');
$data1 = array(
    'name'        => 'lname',
    'id'          => 'lname',
    'value'       => '',
    'maxlength'   => '30'
     );
     $this->table->add_row('<label for="lname">Last Name:</label>', form_input($data1), '* required');
$data2 = array(
    'name'        => 'email',
    'id'          => 'email',
    'value'       => '',
    'maxlength'   => '40'
     );
$this->table->add_row('<label for="email">Email address:</label>', form_input($data2), '* required');
$data3 = array(
    'name'        => 'webad',
    'id'          => 'webad',
    'value'       => '',
    'maxlength'   => '40'
     );
$this->table->add_row('<label for="webad">WebSite:</label>', form_input($data3), '( optional )');
$data4 = array(
    'pse'         => 'howdy',
    'sug'         => 'Site Suggestion',
    'reg'         => 'Regular Advertising',
     );
$this->table->add_row('<label>What do you want to tell us about?</label>', form_dropdown('topic',$data4), '* required');
$data5 = array(
    'name'        => 'comments',
    'id'          => 'comments',
    'value'       => '',
    'rows'        => '7',
    'cols'        => '39'
    );
$this->table->add_row('<label for="comments">
            Your comments:<br/>
            Limit of 250 characters<br/>
     </label>', form_textarea($data5), '* required');
$this->table->add_row('',form_button('submit','Submit'),'');
echo $this->table->generate();
echo form_close();
?&gt;
It looks nice, is this the norm? I think I could have made a dynamic array for the data, values are empty for future dynamics, just following the examples or should I write a function or class for this. Any guidance would help. Thanks Dave


Messages In This Thread
is this a crazy view for a contact form - by El Forum - 08-03-2008, 12:17 AM
is this a crazy view for a contact form - by El Forum - 08-03-2008, 12:37 AM
is this a crazy view for a contact form - by El Forum - 08-03-2008, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB