Welcome Guest, Not a member yet? Register   Sign In
javascript validadation
#1

[eluser]amipaxs[/eluser]
Hi,
I can't get this javascript validation to work ,

Code:
$data=array('name'=>'submit','id'=>'submit','value'=>'Vote');
$js = array('onclick'=> "return confirm('are you sure?');",'', $data);
echo form_submit($data,'', $js));

however, if i put $js first i get only the confirm prompt,but no value on the submit buttom.

Code:
echo form_submit($js,'' ,$data)

whta's the right way to validate using form_submit?
#2

[eluser]amipaxs[/eluser]
i've just found the solution

$js = 'onClick="some_function()"';




Theme © iAndrew 2016 - Forum software by © MyBB