Welcome Guest, Not a member yet? Register   Sign In
Disallawed characters in a form
#1

[eluser]miguelp[/eluser]
hi, i've build a form using the from Helper, it displays ok and it works fine until a submit that form.
i've changes the input library and added a $str to the exit function so i can see what are the characters ( exit('Disallowed Key Characters: '. $str); ).
every time i submit the form it says: Disallowed Key Characters: Array
and i cant figure out why, it all seems to be ok.
here's the form code:
Code:
<div id="arch">
    <div id="holder">
&lt;?php
// constroi array de anos
$actual = date('Y');
$anos = array();
for($i=0;$i<10;$i++){
    
    $anos[$i] = $actual +$i;    
}

//constroi array cidades
$towns=array();
for($e=0;$e<count($cidades);$e++){
    $towns[$cidades[$e]['id']] = $cidades[$e]['nome'];
}

//constroi array tipo de cliente
$ctipo=array();
for($i=0;$i<count($tipocliente);$i++){
    $ctipo[$tipocliente[$i]['id']] = $tipocliente[$i]['tipo'];
}
//constroi array categorias
$categorias=array();

for($i=0;$i<count($cats);$i++){
    $categorias[$cats[$i]['id']] = $cats[$i]['Catnome'];
}

$data = Array(
                1 => array(
                              'name'        => 'codigo_cliente',
                              'id'          => 'codigo_cliente',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'
                              ),
                 2 => array('name'        => 'nome',
                              'id'          => 'nome',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 3 => array('name'        => 'idade',
                              'id'          => 'idade',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 4 => array('name'        => 'email',
                              'id'          => 'email',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 5 => array('name'        => 'telefone',
                              'id'          => 'telefone',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                              
                 6 => array('name'        => 'description',
                              'id'          => 'description',
                              'rows'        => '15',
                              'cols'        => '100',
                              'style'       => 'width:100%'),
                              
                 7 => array('name'        => 'dia',
                              'id'          => 'dia',
                              'maxlength'   => '2',
                              'size'        => '3'),
                              
                 8 => array(
                              'name'        => 'active',
                              'id'          => 'active',
                              'value'       => '1',
                              'checked'     => TRUE,
                              'style'       => 'margin:10px')
);
                              
$meses = array('01'=>'Janeiro',
                '02'=>'Fevereiro',
                '03'=>'Mar&ccedil;o',
                '04'=>'Abril',
                '05'=>'Maio',
                '06'=>'Junho',
                '07'=>'Julho',
                '08'=>'Agosto',
                '09'=>'Setembro',
                '10'=>'Outubro',
                '11'=>'Novembro',
                '12'=>'Dezembro');
                
    echo form_open('admin/insert_client');
        echo "c&oacute;digo cliente: <br />".form_input($data[1]."<br />");
        echo "nome: <br />".form_input($data[2]."<br />");
        echo "idade: <br />".form_input($data[3]."<br />");
        echo "email: <br />".form_input($data[4]."<br />");
        echo "telefone: <br />".form_input($data[5]."<br />");
        echo "descri&ccedil;&atilde;o: <br />". form_textarea($data[6])."<br />";
        echo "validade: <br />". form_input($data[7]) ." ". form_dropdown('mes', $meses, '01') ." ". form_dropdown('ano', $anos, $actual) ."<br />";
        echo "tpo de cliente: <br />". form_dropdown('ctipo', $ctipo, '01') ."<br />";
        echo "categoria: <br />". form_dropdown('cat_id', $categorias, '01') ."<br />";
        echo "cidade: <br />". form_dropdown('cid_id', $towns, '01') ."<br />";
        echo "activo: ". form_checkbox('active','active',TRUE) ."<br />";
        echo form_submit('submit', 'Submit Post');
        echo "&lt;/form&gt;"; //form_close();

?&gt;
</div></div>

can you tell me whats wrong?
thanks in advance
#2

[eluser]coolfactor[/eluser]
You're putting "<br />" tags inside the form_input()'s. Should they not be _after_ the form_inputs()?
#3

[eluser]miguelp[/eluser]
hey, thanks... that was so lame of me...
When you work about 15 / 18 hours a day you came to a point that the much you try to find something the less you see.

Thanks problem solved.




Theme © iAndrew 2016 - Forum software by © MyBB