Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

When submitting forms with multiple checkboxes sharing the same name via GET, only the last value was preserved in query parameters instead of all selected values (?name=value3 instead of ?name=value1&name=value2&name=value3). This caused server-side parameter parsing failures.

Changes

  • helpers.js line 199: Changed url.searchParams.set() to url.searchParams.append() to match the correct behavior already present on line 281

The issue was an inconsistency in query parameter building - the code that constructs the actual server request correctly used append(), but the code that updates the browser address bar used set(), which overwrites duplicate keys.

// Before (line 199)
url.searchParams.set(pair[0], pair[1]);  // Overwrites previous values

// After (line 199)
url.searchParams.append(pair[0], pair[1]);  // Preserves all values

This ensures both the displayed URL and the actual request contain all checkbox values.

Original prompt

This section details on the original issue you should resolve

<issue_title>helper.js does not submit multiple checkbox values via query parameter</issue_title>
<issue_description>When submitting a form with multiple checkbox values of the same group using the GET method, the browser is suppose to repeat the checkbox name with each value in the query parameter:

?name=value1&name=value2&name=value3

However, with helper.js enabled, only the last value gets appended to the query parameters:

?name=value3

This interferes with the server-side parameters parsing and will result in a NoConstructorMatched error.

Removing helper.js from Web/View/Layout.hs fixes this issue.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…params

Co-authored-by: mpscholten <2072185+mpscholten@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix multiple checkbox values submission in helper.js Fix multiple checkbox values lost in GET form submissions Dec 11, 2025
Copilot AI requested a review from mpscholten December 11, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

helper.js does not submit multiple checkbox values via query parameter

2 participants