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

Provide method for setting error state #1136

Closed
Garbee opened this issue Jul 20, 2015 · 3 comments
Closed

Provide method for setting error state #1136

Garbee opened this issue Jul 20, 2015 · 3 comments

Comments

@Garbee
Copy link
Collaborator

Garbee commented Jul 20, 2015

Action: Add method to textfield component to allow developers to set an error state and message.

@Sparticuz
Copy link

You can use the following to force an input into an invalid state programmatically.

document.getElementById('input-field').parentElement.className += ' is-invalid';
document.getElementById('input-error').textContent = 'Error Message';

@Sparticuz
Copy link

Actually, because the error and the input field are siblings, you could use

var ele = document.getElementById('input-error');
ele.parentElement.className += ' is-invalid';
ele.textContent = 'Error Message';

@traviskaufman
Copy link
Contributor

Closing this; superseded by #4479 . This seems like something we'd probably want to carry over to our v2 implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants