Prevent Submitting A Yii::button

VIEW





echo CHtml::submitButton(

Yii::t ('Somethin', 'next'),

    array( 

        'name' => 'next', 

        'onclick' => "checkDetails()"

    ));

[b]

JS[/b]


checkDetails() {

    PREVENT_SUBMITTING

}



How should PREVENT_SUBMITTING look? What would prevent submitting in this case, without any condition? A simple


event.preventDefault() // or


return false;

does not work…

Many thanks…

try this onclick=>"return checkDetails( )"

thank you but, it does not work. I am a little desperate, does yii overwrite this somewhere, somehow?

have you tried with form onsubmit event?

Hi,

I hope this link will clear your doubt

http://stackoverflow.com/questions/12837963/onclick-submit-button-not-returning-javascript-function-yii