question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form input data-error does not show.

See original GitHub issue

First of all I would like to say how happy i am with this framework. It has provided me with many features I like to use. I would like to insert form errors on my contact form when it is not filled in correctly. Unfortunately, using the attributes data-error and data-success does nothing to the input and I have not seen an open issue on this yet.

I am using the following markup:

<i class="material-icons prefix">account_circle</i>
    <input id="name" type="text" class="validate">
    <label for="name">Name</label>
</div>

2015-07-17 23_18_53-portfolio

I am programmaticly adding the data-error="name is required" once the form has not been filled in correctly. I have checked the javascript and I can see in the console that the data-error attribute is inserted into the corresponding label, but nothing changes. Adding the attributes natively also does not make any changes.

Please help me out. I will provide further information if needed.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
iperetocommented, Dec 1, 2016

@Clemzd This code not work when change class of the field datefield to datepicker of materializecss, because the attribute data-error is present but it is not show in the frontend. I see that ::after is not present. Anyone know what happend with this? I’m trying to fix this, but we can solve it together easyly.

Sorry for my english.

image

You can see in the image that ::after in into the label Standard Field 2, but in the date field ::after is not present and I think that for that reason data-error is not present in the UI.

1reaction
iperetocommented, Dec 2, 2016

Hello guys,

Thank you @Clemzd, I use your code to implement a datepicker and select to test the data-error in these fields.

https://jsfiddle.net/ipereto/28maedmf/

@ronanversendaal, I hope this can help to everyone that require this type of validation with materializecss in your software.

Read more comments on GitHub >

github_iconTop Results From Across the Web

data-error-message dont work in input - Stack Overflow
i have code that like :- data-error-message="Error Enter name". this attrbute not work in input type. how can i worked it.
Read more >
Handling errors that occur during data entry in DataGridView ...
Use this walkthrough to learn about handling errors that occur during data entry in the Windows Forms DataGridView control.
Read more >
Contact Form Validation - Processing Data Error? - SitePoint
The form validation appears to be working without a problem but on clicking “Send message”, the form is supposed to reference the process.php ......
Read more >
Showing custom validation error in HTML5 - Tech Funda
after checking if that element is not valid, setting its customValidity to that particular element's "data-error" attribute value. OUTPUT. Custom validation ...
Read more >
Handling operation errors - Apollo GraphQL Docs
Resolver errors (e.g., an error occurred while attempting to populate a query field). If a syntax error or validation error occurs, your server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found