Reputation: 57
<?= '<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
'Exit(admin)',
['class' => 'btn btn-warning']
)
. Html::endForm()
. '</li>'?>
This code is working, but I want to change submit button to html::a
. When I try to do it, it's not working.
Upvotes: 0
Views: 1247
Reputation: 210
It is not recommend to use a link as submit button, anyhow if you want, here is code
<?php echo Html::a('Exit(admin)',$url=false,['class'=>'btn btn-warning','onclick'=>'submitForm()']); ?>
in javascript
function submitForm(){
document.getElementById('FormId').submit;
}
Upvotes: 1