Welcome Guest, Not a member yet? Register   Sign In
How to Apply style and JS to form_submit ?
#1

[eluser]minoh[/eluser]
hi guys,

someone know how to apply style and JS to a form_submit, in my former html i have got this submit button :
Code:
&lt;input id="button"&gt;&lt;br/><br/>

but now i want to apply it to my form_submit, and i dont know howto !!
#2

[eluser]davidbehler[/eluser]
More or less taken from the User Guide:
Code:
$data = array(
    'name' => 'button',
    'id' => 'button',
    'value' => 'Submit',
    'class' => 'myclass'
);
$js = 'onClick="some_function()"';
echo form_submit($data, '', $js);
#3

[eluser]minoh[/eluser]
this is what i put in my login body view :
Code:
$bdata = array(
    'name' => 'button',
    'id' => 'button',
    'value' => 'Submit',
    'type' => 'image',
    'src' => 'pathToSrc'

);
$js = array(
    'onmouseover'=>'over_login()',
    'onmouseout'=>'out_login()'
);
echo form_submit($data, '', $js);
but i just get a trasparent button out of my login box with juste the submit value.
#4

[eluser]davidbehler[/eluser]
Try removing the 'type' => 'image' party rfom the $data array. I'm guessing that overrides the type="submit" that's set by the form_submit() function.




Theme © iAndrew 2016 - Forum software by © MyBB