I m doing an app in CakePHP, JQuery and Mysql. In my homepage I am listing all my form names. When I click on a form name, it will show the form. Within that view, I have code that looks like this
<?php echo $form->input($r['Attribute']['label'], array(
'type'=>'text',
'style"=width:' => $r['Attribute']['size']
));
?>
to generate a textbox with the label that I got it from $r['Attribute']['label'] and to keep the width of it using that style. However, the width is not working.
This should do it:
<?php
echo $form->input($r['Attribute']['label'], array('type'=>'text','style' => 'width:' . $r['Attribute']['size'] . 'px'));
?>
Two things: Your array key->value pairing was messed up, and you need to give units to the width. I assumed that want you wanted to give it was a width in pixels, but if you just want to set the size of the input field you can do this:
<?php
echo $form->input($r['Attribute']['label'], array('type'=>'text', 'size' => $r['Attribute']['size']));
?>