Skip to content

Get the query params from an link or specified tag hx-vals ? #2534

Closed Answered by zw963
zw963 asked this question in Q&A
Discussion options

You must be logged in to vote

Oops, i fix my issue for add a hidden input tag, which nested inside the div#main.

div id: "main" do
  ....
  input type: "hidden", name: "batch_level", value: context.request.query_params["batch_level"]?.to_s
  ...
end

When i click the link, the server's response updated this input tag value use context.request.query_params,
then, change search input use hx-include.

input(
      type: "search",
       ...
	   
	   "hx-include": "[name='batch_level']"
    )

It works!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zw963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant