I use href to send action to the controllr but I ask if it's possible to use button instead href to do the action. this is my code
<a href="{{ path('adduser') }}" class="btn btn-lg btn-default highlight_black stylish ">create user</a>
so instead <a href ...>
I want to use
<input type="button">
Thanks for help
I use href to send action to the controllr but I ask if it's possible to use button instead href to do the action. this is my code
<a href="{{ path('adduser') }}" class="btn btn-lg btn-default highlight_black stylish ">create user</a>
so instead <a href ...>
I want to use
<input type="button">
Thanks for help
Share Improve this question edited Feb 16, 2016 at 19:59 chalasr 13.2k5 gold badges43 silver badges83 bronze badges asked Feb 16, 2016 at 9:31 Majdi TalebMajdi Taleb 7613 gold badges9 silver badges26 bronze badges2 Answers
Reset to default 4I added a script
document.getElementById("mybutton").onclick = function () {
location.href = "{{ path('adduser') }}";
};
and now it work perfectly
Thanks for your helps
I don't see the point of make your links using an input, but yes, you can.
Do something like this :
<input type="button" onclick="location.href = {{ path('adduser') }};" />