[eluser]halwaraj[/eluser]
I have this Page with following code in a view file:
Code:
<table>
<tr>
<td>
<?php echo form_button($resetButton,"",$js_Reset); ?>
</td>
</tr>
</table>
The following is the array being passed to the form_button function above.
Code:
$resetButton = array(
'name' => 'resetButton',
'id' => 'resetButton',
'value' => 'false',
'type' => '',
'content' => 'Reset'
);
The following is the javascript code that goes into the function.
Code:
$js_Reset = 'onclick="resetClicked()"';
The javascript code for the function refered.
Code:
function resetClicked(){
alert("RESET CLICKED . . .");
return false;
}
So, Now, the problem that I am facing is that eventhough I return a false in the js function, when I click the Reset button, the page gets submitted.
My question is why does it get submitted eventhough I return false from the js function. Any ideas?