[eluser]dallen33[/eluser]
So here's my code:
Code:
<?php
$name = array(
'name' => 'name',
'id' => 'name',
'size' => 10,
'value' => set_value('name')
);
$short_name = array(
'name' => 'short_name',
'id' => 'short_name',
'size' => 10
);
$width = array(
'name' => 'width',
'id' => 'width',
'size' => 10
);
$height = array(
'name' => 'height',
'id' => 'height',
'size' => 10
);
$exp_width = array(
'name' => 'exp_width',
'id' => 'exp_width',
'size' => 10
);
$exp_height = array(
'name' => 'exp_height',
'id' => 'exp_height',
'size' => 10
);
$expanding = array(
'FALSE' => 'Non-Expanding',
'TRUE' => 'Expanding'
);
?>
<p>
<?php echo anchor($this->dx_auth->logout_uri, $this->lang->line('common_logout'));?></p>
<?php echo $this->dx_auth->get_username();?>
<?php echo $this->dx_auth->get_firstname();?> <?php echo $this->dx_auth->get_lastname();?>
<?php
echo form_open($this->uri->uri_string());
if ($adsizes_query->num_rows() > 0):
foreach($adsizes_query->result() as $adsizes_row):
// Find whether ad is expanding or isn't
if ($adsizes_row->expanding === "TRUE"):
$is_expanding = "TRUE";
elseif ($adsizes_row->expanding === "FALSE"):
$is_expanding = "FALSE";
endif;
?>
<p>
<?php echo $adsizes_row->name;?>
<?php echo form_input($short_name, set_value($short_name['name'], $adsizes_row->short_name));?>
<?php echo form_error($short_name['name']);?>
<?php echo form_input($width, set_value($width['name'], $adsizes_row->width));?>
<?php echo form_error($width['name']);?>
<?php echo form_input($height, set_value($height['name'], $adsizes_row->height));?>
<?php echo form_error($height['name']);?>
<?php
if ($is_expanding === "TRUE"):
echo form_input($exp_width, set_value($exp_width['name'], $adsizes_row->exp_width));
echo form_error($exp_width['name']);
echo form_input($exp_height, set_value($exp_height['name'], $adsizes_row->exp_height));
echo form_error($exp_height['name']);
endif;
?>
<?php echo form_dropdown('expanding', $expanding, $is_expanding);?>
<?php echo $adsizes_row->proof_bg;?>
</p>
<?php
endforeach;
endif;
echo form_close();
?>
It basically shows rows of ad sizes with names, type, bg, etc. Instead of having a "Submit" button on each row, I'd like just one submit button on the bottom. So how do I differentiate between every input name/id? What's the best way of doing this?
I was thinking of somehow incrementing a number for the name/id, but not too sure how to do that, or even if it's the best way of doing it. Any help would be appreciated!