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

Changes on hidden fields not beeing re-validated #802

Closed
mediafreakch opened this issue Jun 27, 2013 · 6 comments
Closed

Changes on hidden fields not beeing re-validated #802

mediafreakch opened this issue Jun 27, 2013 · 6 comments

Comments

@mediafreakch
Copy link

Some fancy jQuery plugins (e.g. slider) use hidden form input fields to set & submit values to server-side). If you want to validate them too, you can simply set .setDefaults({ ignore: "" }) . It will then be validated and error messages will be shown. However, the plugin does not bind any event listeners to the invalid hidden input fields to track the changes there.

Desired behaviour: The plugin should register an onChange event listener on every input field that hasn't been set to be ignored via .setDefaults({ ignore: ""}) option once the form submit event has been triggered. Like it registers onfocusout, etc., event listeners for other input fields.

@killthekitten
Copy link

+1 for this

@killthekitten
Copy link

I think it is related to #189

@jzaefferer
Copy link
Collaborator

I don't see how even handlers on hidden elements would help. If they are hidden, there will be no events. Other JS code can change their value, but events are triggered only by changes made by the user. Your best bet is to trigger validation for hidden fields based on when their value changed, e.g. hook into a callback of the slider and use that to revalidate the hidden field.

@mhetreramesh
Copy link

+1 for this

@3zzy
Copy link

3zzy commented Aug 28, 2017

+1

1 similar comment
@jackie-d
Copy link

+1

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

6 participants