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

Field type text required #21

Open
viniciusjau opened this issue Mar 18, 2015 · 4 comments
Open

Field type text required #21

viniciusjau opened this issue Mar 18, 2015 · 4 comments

Comments

@viniciusjau
Copy link

Hi guys!

How create a field type text required?
To use in a field with the name...

@jh3y
Copy link

jh3y commented Mar 18, 2015

Hey @viniciusjau,

Could you elaborate?

Forgive me, for I haven't looked at the project for some time. But, if you have a field that is of type text and required, you could simply use the HTML5 attribute required attribute if using a browser > IE9 and !Safari. It also depends on the context and set up of your project. For example, something like Angular has this functionality available within its basic validation directives. Or jQuery validate also offers a solution to requiring input in a field.

Formance caters to more specific fields with regards to their validation and formatting.

@jh3y

@viniciusjau
Copy link
Author

Yes could use the HTML5 attribute.. but I would not get this effect
form

@jh3y
Copy link

jh3y commented Mar 19, 2015

The effect is achieved using CSS. You could write some CSS and apply it to your input. For the invalid label either opt to use maybe a CSS pseudo element or a styled label that appears in a show/hide manner.

@jh3y

@autoboxer
Copy link

I agree, having a base required field type would be very helpful. The benefit of a library like this is consistency through the validation handling. Most users will have a need for this basic functionality and won't want to roll their own solution using the HTML5 attribute.

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

3 participants