I seem to always have issues with this and can never remember how to resolve it. I have spent the past two days reviewing the forum trying to find a solution and have not been able to find one that works. I am sure I have missed something very simple, because this is a fundamental thing, but the answer escapes me.
What I would like to do is have either a button or a link on a nodejs page that when clicked takes a user to an edit page but it could also be something that links to a details page, etc.
I have my route set up as /company/edit-national/:id
I have two buttons set up on a page. Both work the same way, but come about it differently.
The first button is an anchor button with the following attributes.
The second is a regular button with the following attributes.
Both buttons function properly and open up the page correctly.
I have created a server action that calls the for the parameter “id”.
On the layout page, I set the query parameter “id”.
On the layout page, I created a simple header that calls for a value from the server action.
On loading the page, no results are found from the server action.
There are no console errors on the page.
If I enter a default value in the server action, results are shown and displayed on the page.
I am sure this is something very simple that I have overlooked, but the solution escapes me.