Skip to content
Advertisement

Error on input validation even though input exists

I have an application where an user can change his name via a pop-up.

This is the method that handles the name change:

JavaScript

This is the blade file with the modal:

JavaScript

The issue is when I have the required in the request validation I always get the error, when I delete the required everything works perfectly. I need it because a user should not be able to rename his name to an empty one.

Advertisement

Answer

You have a mistake on name of new name input. its not same as validators key
change your validator like this

JavaScript

it will work

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement