form_submit - Adding a class |
[eluser]Shella[/eluser]
Hi everybody, I'm kinda new with codeigniter and I'm looking to manage this form_submit styling. Actually if I use: Code: form_submit('submit', 'Publish'); I return this: Code: <input type="submit" value="Publish"> What I can do to return: Code: <input type="submit" value="Publish" class="alt_btn"> Thank fools! Shella
[eluser]Unknown[/eluser]
Code: $attributes = array('class' => 'my_class');
[eluser]sanir[/eluser]
Please checkout user guide for form helper. http://ellislab.com/codeigniter/user-gui...elper.html Thanks, Nasir Ranta
[eluser]Shella[/eluser]
Mmmm... don't ask me WHY but I followd your tips and it doesn't work like that. I managed coding this. It works but sincerely I don't know if this is a workaround or something else: Code: $attributes = array('class' => 'class="alt_btn"'); Thanks
[eluser]sanir[/eluser]
Code: $attributes = 'class = "alt_btn"';
[eluser]Shella[/eluser]
Yep, working. I understand how it works thanks. By the way I guess the user manual related is not appropriate in this case, don't you reckon? Cheers & thank for help
[eluser]Aken[/eluser]
The third parameter expects a string, not an array. The user guide doesn't specify which format it should be in, which could be improved upon.
[eluser]Unknown[/eluser]
You could just do echo form_submit('send', 'Publish', 'class="alt_btn"'); |
Welcome Guest, Not a member yet? Register Sign In |