Welcome Guest, Not a member yet? Register   Sign In
[newbee] code outputs only html
#8

[eluser]TheFuzzy0ne[/eluser]
[quote author="Rokit" date="1209167596"]I did try this <?php function... but still no output.

Form
Code:
<?php $this->validation->error_string; ?>

<?php form_open('form'); ?>
    <b>Titel van dit album</b><br />
    &lt;input type="text" name="titel_album" value="" /&gt;<br /><br />
    &lt;input type="submit" name="toevoegen" value="Album toevoegen" /&gt;
    
&lt;/form&gt;

The controller
Quote:class Pictures extends Controller {

function index(){
-
$this->load->helper(array('form', 'url'));

$this->load->library('validation');

$rules['titel_album'] = "required";


$this->validation->set_rules($rules);

if ($this->validation->run() == FALSE)
{
$this->load->view('pictures/addalbum');
}
else
{
$this->load->view('formsuccess');
}

}

}

Html source
Code:
<b>Titel van dit album</b><br />
    &lt;input type="text" name="titel_album" value="" /&gt;<br /><br />
    &lt;input type="submit" name="toevoegen" value="Album toevoegen" /&gt;
    
&lt;/form&gt;

- When i look at the source i see also no form open tags (&lt;form method=...)
- When i submit the form (empty field) i get no error[/quote]

The most likely reason you aren't getting the error string is that your first line of code appears to be missing an "echo".

try:

Code:
&lt;?php echo $this-&gt;validation->error_string; ?&gt;

&lt;?php form_open('form'); ?&gt;
    <b>Titel van dit album</b><br />
    &lt;input type="text" name="titel_album" value="" /&gt;<br /><br />
    &lt;input type="submit" name="toevoegen" value="Album toevoegen" /&gt;
    
&lt;/form&gt;

With a bit of luck that might fix your problem, (although it does appear completely unrelated).


Messages In This Thread
[newbee] code outputs only html - by El Forum - 04-25-2008, 10:32 AM
[newbee] code outputs only html - by El Forum - 04-25-2008, 11:03 AM
[newbee] code outputs only html - by El Forum - 04-25-2008, 11:38 AM
[newbee] code outputs only html - by El Forum - 04-25-2008, 11:56 AM
[newbee] code outputs only html - by El Forum - 04-25-2008, 12:27 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 12:53 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 12:58 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 01:01 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 01:02 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 01:16 PM
[newbee] code outputs only html - by El Forum - 04-25-2008, 01:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB