Welcome Guest, Not a member yet? Register   Sign In
button css
#1

[eluser]davy_yg[/eluser]

Hello,

my html css works well:

<input type="submit" name="submit" value="kirim" class="button">

contact.css

Code:
#carticle3 .button {border:2x solid; background-color:#efeded; padding: 3px; border-radius: 4px; width: 80px;}

Then, when I change the code to this:

Code:
<?php    
  
      echo form_submit('submit', 'kirim');

?&gt;<br>

The button css does not apply. What should I do so that the button css still being applied to the button.

#2

[eluser]davidMC1982[/eluser]
Code:
&lt;?php    
  
      echo form_submit('submit', 'kirim', array('class' => 'button'));

?&gt;<br>
#3

[eluser]davy_yg[/eluser]

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: helpers/form_helper.php

Line Number: 450


I autoload my helper:

autoload.php

Code:
$autoload['helper'] = array('url', 'form');
#4

[eluser]Otemu[/eluser]
Hi,

You need to follow as said in the guide

Quote:Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes.

So change this:

Code:
echo form_submit('submit', 'kirim', array('class' => 'button'));

to something like:

Code:
echo form_submit( array('class' => 'button', 'name' => 'kirim'), 'submit' );




Theme © iAndrew 2016 - Forum software by © MyBB