CodeIgniter Forums
form_submit - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: form_submit (/showthread.php?tid=50759)



form_submit - El Forum - 04-07-2012

[eluser]Josssi[/eluser]
Hi people,

isnt possible write someting like this below?

Code:
echo form_submit('submit', 'Zobraziť', array('class'=>'blue_button'));

I need to add class to my button because i want to give him other luck in css like for other buttons. Exist some way to write it without mortal HTML <div>?

Thanks


form_submit - El Forum - 04-07-2012

[eluser]Samus[/eluser]
[quote author="Josssi" date="1333797596"]Hi people,

isnt possible write someting like this below?

Code:
echo form_submit('submit', 'Zobraziť', array('class'=>'blue_button'));

I need to add class to my button because i want to give him other luck in css like for other buttons. Exist some way to write it without mortal HTML <div>?

Thanks[/quote]

You either add the name & value in the first & second parameters respectfully.

Or you write everything in an array.

Code:
echo form_submit('submit', 'Zobraziť');

or

Code:
echo form_submit(array('name' => 'submit', 'value' => 'Zobraziť', 'class' => 'blue_button'));



form_submit - El Forum - 04-07-2012

[eluser]Aken[/eluser]
Actually you can use a third parameter, it just needs to be a string instead of an array. Otherwise Samus' method works great, too.

Code:
echo form_submit('submit', 'Zobraziť', ' class="blue_button"');