I have a custom module where I create a table from some data. In one of the columns I need to have a button that when clicked will open a new tab and show the user a form and a submit button and some of the form fields are pre-filled with data from the table (data from the same row).
I know how to add a button but I don't know how to pass the data to the form.
Also, for the button I'm using the following code and maybe this is already wrong:
$new_button = '<a href="/examples/form-example" target="_blank" class="btn btn-primary" role="button">New form</a>';
Note: the data is not in the drupal database. The table is made on the fly using REST.
Any help will be greatly appreciated. Thanks!