How to redirect when click a drop-down list entry? Used as navigation in the top bar

Just like the navigation bar in the official site of CakePHP.
All I know to do this is creating a form with a select list, adding a submit button then redirecting when submit. But can we just redirect when click the list entry?

Hey!
If you look at the elements of the CakePHP website you will see that this is an unordered list of links ( “a”-elements). So this is one way to make redirections happen.

You could also use a form for this having all the list elements as buttons with a particular id which would be then the redirection variable.

Also you could redirect using JavaScript/JQuery here.

Not sure if there are other ways to do that.

Hope it helps, Rich

Thank you very much for reply, Rich!
I’ll look into it later. Through your reply I understand the HTML machanism here. And now I’m looking for an appproach to accomplish this feature using functions within CakePHP framwork. Hope I can succeed.
Thank you again!

Happy to help you!
Let me know if something worked for you. If not you could still post some example code to have a better picture of what not worked. Keep up coding! :slight_smile: