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

Only send checkbox/radio values for remote validation if checked #82

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Only send checkbox/radio values for remote validation if checked #82

merged 1 commit into from
Dec 12, 2023

Commits on Dec 12, 2023

  1. Only send checkbox/radio values for remote validation if checked

    Doing remote validation for a checkbox value always sends the input's value whether the checkbox is checked or not and since the value is set to "true" for checkboxes the value will always be true on the server side even if you unchecked the checkbox when the remote validation was triggered. This change fixes this by only sending the value if the checkbox was checked. This is similar to what jquery-validation-unobtrusive does to handle remote checkbox validation.
    
    I also added radio buttons to the check but I don't think it will work correctly for them since there will be multiple inputs with the same name selector for radio buttons but only the first one is handled which might not be the one that is clicked. So I'm not sure what the correct approach is for remote validation of radio buttons but this at least seems to be more in line with how jquery-validation-unobtrusive handles them.
    davidkarlsson committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    a1d2b9e View commit details
    Browse the repository at this point in the history