- Issue created by @nikathone
- Merge request !22Implemented a addFormDataToURL that adds FormData to a url as search query. → (Open) created by nikathone
Using URLSearchParams in ajax before submit can break the search when a checkbox input has a name with a plus sign in it.
Not sure how to present the data but in views we have a checkbox with the following html:
<input data-drupal-selector="edit-intended-population-lgbtq-inclusive" class="form-checkbox" type="checkbox" id="edit-intended-population-lgbtq-inclusive" name="intended_population[LGBTQ+ inclusive]" value="LGBTQ+ inclusive">
When this checkbox is clicked for the first time, the search parameter get added like this intended_population[LGBTQ+%20inclusive]=LGBTQ%2B%20inclusive
. You will notice that the value (LGBTQ+ inclusive
) is properly encoded to LGBTQ%2B%20inclusive
(the plus and the space characters are all encoded) but on the key side, <code>intended_population[LGBTQ+%20inclusive]
only the space character is encoded.
Implement a function to add FormData to url instead of using URLSearchParams
that can sometimes have a problem with preserving the plus signs.
N/A
N/A
N/A
Active
1.0
Code