Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS error: Field IDs contain "%3D" urlencoded equal sign, causing errors #286

Open
Ciantic opened this issue Mar 17, 2023 · 0 comments
Open

Comments

@Ciantic
Copy link

Ciantic commented Mar 17, 2023

Hello

Gutenberg Forms seems to be using some sort of base64 to generate ID's, that doesn't work since Base64 includes = at the end nearly randomly.

E.g.

e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D

Notice %3D this is causing JS errors.

<!-- wp:cwp/name {"isRequired":true,"label":"Nimi","id":"e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D","field_name":"name-e48ec1","messages":{"0":{},"empty":"Please fill out this field!","invalidName":"The name {{value}} is not valid!","fieldName":"name"},"condition":{"field":"select-3d4ac9","condition":"===","value":""},"adminId":{"value":"name_e48ec1","default":"name_e48ec1"}} -->
<div class="wp-block-cwp-name cwp-name cwp-field"><div class="cwp-field-set"><label for="e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D">Nimi <abbr title="required" aria-label="required">*</abbr></label><div class="cwp-field-with-elements"><input id="e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D" aria-label="Nimi" data-cwp-field="true" name="e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D" title="The name {{value}} is not valid!" data-errors="{&quot;mismatch&quot;:&quot;The name {{value}} is not valid!&quot;,&quot;empty&quot;:&quot;Please fill out this field!&quot;}" type="text" data-rule="false" placeholder="" required/></div></div></div>
<!-- /wp:cwp/name -->

It seems to be generating these IDs somehow, even if I remove %3D from the code they come back.

JS error they give looks like this:

jquery-3.2.1.min.js:2 Uncaught Error: Syntax error, unrecognized expression: input#e48ec1__LS1uYW1lLWU0OGVjMS10cnVlLW5hbWUtbmFtZV9lNDhlYzE%3D
    at ga.error (jquery-3.2.1.min.js:2:13370)
    at ga.tokenize (jquery-3.2.1.min.js:2:19359)
    at ga.select (jquery-3.2.1.min.js:2:22249)
    at Function.ga [as find] (jquery-3.2.1.min.js:2:7208)
    at r.fn.init.find (jquery-3.2.1.min.js:2:24940)
    at new r.fn.init (jquery-3.2.1.min.js:2:25430)
    at r (jquery-3.2.1.min.js:2:601)
    at cipFields.setUniqueId (kphc.js:820:19)
    at HTMLInputElement.<anonymous> (kphc.js:844:14)
    at Function.each (jquery-3.2.1.min.js:2:2715)
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

No branches or pull requests

1 participant