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

"An invalid form control with name='' is not focusable" when "required" #73

Closed
mucahittopal opened this issue Jul 25, 2020 · 9 comments
Closed

Comments

@mucahittopal
Copy link

I found the solution like this ;

function updateAttributes() {
// copy properties from original to the new input
$input.prop("name", $original.prop("name"))
$original.removeAttr("name")

$input.prop("required", $original.prop("required"))
$input.prop("placeholder", $original.prop("placeholder"))
.
.
.

@shaack
Copy link
Owner

shaack commented Jul 26, 2020

Does it make sense? After that you have two inputs in one form with the same "name", one with the correct value ($original) and one with a localised value ($input).

@mucahittopal
Copy link
Author

I think it makes sense :) Because new $input "name" created same as original and removed $original "name" on input

@shaack
Copy link
Owner

shaack commented Jul 27, 2020

Ok, right. :) But why? What is the benefit? And how do you handle localized numbers on the server? en: 1,200.5 is in de: 1.200,5 and in es 1200,5 and in ru 1 200,5

@mucahittopal
Copy link
Author

This is benefit of browser checking validation. Our localized numbers : 1.200,5

Like localized DE

@shaack
Copy link
Owner

shaack commented Jul 27, 2020

You have only users from one country? Browser checking validation works without your modification or I did not get what you mean. The value is automatically copied to $original.

@mucahittopal
Copy link
Author

Yep!
Browser checking validation works but when use to "required" I am getting an error on developer console "An invalid form control with name='adet' is not focusable."

@shaack
Copy link
Owner

shaack commented Jul 27, 2020

Ahhh, ok! Now we get to the real problem. https://stackoverflow.com/questions/22148080/an-invalid-form-control-with-name-is-not-focusable
You are right, there is an issue with invisible "required" fields. Maybe the solution is to remove the "required" field from "$original", I will try this out now....

@shaack shaack changed the title Can you update new input name for original input name? "An invalid form control with name='' is not focusable" when "required" Jul 27, 2020
@shaack shaack closed this as completed in fa32288 Jul 27, 2020
@shaack
Copy link
Owner

shaack commented Jul 27, 2020

Fixed the "required" Problem in 1.13.13. Does it work for you now?

@mucahittopal
Copy link
Author

Thanks bro, it's worked :)

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

2 participants