how to show validation message like the below shown images on a html form.
I tried in Web, but could not found like this validation. So though to ask you here, may be someone can help me with this.
I want to show valdation error message as shown in below image...
Please anyone help me...
OR LIKE THIS BELOW IMAGE
The Validation Error Message property lets you define a custom error message to display if the validation checks specified in the Validation (Regex) fails.
Adding an else statement to return the value of your error message span to a non-error state could correct this. this should display your error msg and return it to blank when a valid input is present.
On error display I would do it like this:
Now if you compress those steps you would get an HTML structure like.
<div class="fieldWrapper" style="position: relative;">
<input ....>
<div class="errorMessage" style="position:absolute; left:100%;"> Error message </div>
</div>
If don't want to add the additional "fieldWrapper" divs
you could set the top and left of the error message programmatically like this:
offsetTop
of the field and the offsetLeft
top
and left
value of the error message.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With