I'm trying to add a class to form_submit in PHP Codeigniter; Im doing with the following code:
$attributes1=array(
'class'=>'btn btn-danger',
);
echo form_submit('loginSubmit', 'Login',$attributes1['class']);
But the rendered code in HTML is as following:
<input type="submit" name="loginSubmit" value="Login" btn="" btn-danger="">
could you please let me know who I can the class to my form_submit?
Also If it is not clear please let me know which part is ambiguous so I will provide more clarification
Many thanks
Use Like this
echo form_submit('loginSubmit', 'Login',"class='btn btn-danger'");
I use it like this:
echo form_submit(array(
'id' => 'submit',
'value' => 'Enter',
'class' => 'btn btn-primary'
));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With