[eluser]Adam Griffiths[/eluser]
[quote author="dbashyal" date="1225015422"]did you turn on error reporting?
by the way isn't it suppose to be $action inplace of $data['action'] in form view and so on...[/quote]
It is supposed to be $data['action'] because I pass it through my crud library, it's a little complex to explain without the code but anyways thanks for the input.
[quote author="Randy Casburn"]Hi Adam,
If what you have your submit button show up but nothing else, it appears to me that your array $fresh is empty. So the foreach() loop never executes and your form elements are never built. That would appear to mean only the form header and submit button are put up there.
Just a guess really. Hope that’s helpful.
Randy[/quote]
I just dumped that variable and nothing was outputting from the view, but inside the library it was fine. So I went through my view and took out the parts that fill in the form again if something goes wrong and the variables that show the error and now the form shows. Step 1 complete.
But now when I submit the form nothing happens, it comes back to the form, no errors are shown at the top or anything. Here's the new view code.
Code:
<div id="top">
<strong><?php echo $data['headline']; ?></strong>
<p><?php echo $data['byline']; ?></p>
</div>
<div class="title">
<?php echo $data['title']; ?>
<?php admin_pages(); ?>
</div>
<div class="box">
<?php
echo validation_errors();
echo form_open($data['action'])."\n";
?>
<table cellspacing="2" cellpadding="4">
<?php
foreach($fresh as $fields => $var)
{
if(strstr($var->name, 'id'))
{
}
elseif($var->type === 'blob')
{
$data = array(
'name' => $var->name,
'class' => 'blob'
);
echo('<tr><td valign="top">');
echo(ucfirst($var->name)."</td><td>".form_textarea($data)."</td></tr>\n");
}
elseif($var->type === 'int' || 'string')
{
$data = array(
'name' => $var->name,
'class' => 'form'
);
echo("<tr><td>");
echo(ucfirst($var->name)."</td><td>".form_input($data)."</td></tr>\n");
}
}
?>
<tr><td colspan="2"><?php echo form_submit('addpage', 'Add Page'); ?></td></tr>
</table>
</form>
</div>
<div class="box_bottom"></div>
Thanks for the input guys it really is appreciated.