Questions tagged [constraint-validation-api]

The Constraint Validation API allows validation of HTML form inputs before submission. Use this tag for questions about the Constraint validation API.

Constraint Validation API

The Constraint Validation API allows validation of HTML form inputs before submission.

References

47 questions
0
votes
0 answers

checkValidity() returning valid on form reload

I have a Rails application that spits back out a form with backend validation error messages. The form itself uses HTML5 constraint validation on the frontend. I'm running into an issue where when I submit a form that is invalid directly to the…
crespire
  • 33
  • 1
  • 7
0
votes
0 answers

Access Default Validation Messages via the Constraint Validation API

The HTML Constraint Validation API provides default error messages. For example, when the user enters an invalid pattern, the message below is automatically provided: Please match the requested format. These messages are useful because they're…
0
votes
2 answers

How to locate the Constraint validation text using Selenium and Java

I'm trying to make a Selenium test script that checks if a bootstrap validation popover appears when submitting a form containing a bad value. My script below returns this error: org.openqa.selenium.NoSuchElementException: no such element: Unable…
Cody
  • 1,801
  • 3
  • 28
  • 53
0
votes
1 answer

How to show form validation errors in inputs NOT one by one in popups?

I have a very simple form here with 2 required inputs. When you click submit button without filling them - there are popups saying that you should do it. The problem is that popups are showed one by one - for example, if both inputs arent filled,…
0
votes
2 answers

How to verify login text box validation error message using Selenium

URL- https://www.vtiger.com/begin-free-trial Enter an invalid email address such as "abcde" and now click on Next Button. You will notice an error message which will appear for 4/5 seconds ( image below ) How can we verify this error message, I am…
0
votes
1 answer

How to read HTML5 Constraint validation error message using javascript in Selenium

I have a form that has required fields when I try to submit the form with blank required fields an error message is displayed as shown below in the screenshot. with Selenium in Java its not possible to identify if the error message is displayed as…
0
votes
1 answer

How do you wire up jQuery global event handler for HTML5 date constraint validation?

I have a html5 date control with a min/max contraint as below. The control can sometimes be loaded via ajax and there may be occasions when there are multiple of these…
0
votes
3 answers

How to get the Email/Text entered into a field when there is no "value" attribute or text in the code snippet for Java Selenium

I want to Get the email id entered "arjun_123@gmail.com" using java code. I tried the below codes, but it always returned null. What I really need is, I want to check whether email is successfully entered or not. Sometimes, email is not getting…
Arjun
  • 321
  • 3
  • 9
  • 20
0
votes
2 answers

How can I extract the text of HTML5 Constraint validation in https://www.phptravels.net/ website using Selenium and Java?

I have tried switch to alert but it's showing no such alert found error. And i have also tried ifranes,windowhandling. The popup stays for only 1-2 sec and I can't use inspect element to get the xpath of that. Please check the scrrenshot attached.
0
votes
1 answer

How to break text passed to setCustomValidity?

I'm validating data entered in a form using HTML5. Is there a way of breaking the string passed as an argument of method setCustomValidity()? I've tried different combinations of a carriage return and line feed, non of them working. They're not…
0
votes
0 answers

How to manually reset the input validation state in IE after form reset?

It appears as though Internet Explorer does not reset the validation state (both .checkValidity() and validity.valid) after a default form reset. This does work as expected in Chrome and Edge. Does anyone have any insight into this issue, and how to…
0
votes
2 answers

HTML Validation message?

I have used HTML in my new project and seems pretty nice to use some of the new features. However there is a few things that are iffy and I can get them to work. For example if I use pattern attribute for my field validation error message isn't…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
0
votes
0 answers

HTML Input Validation on ASP.NET Web Form with multiple forms

I have multiple forms on a ASP.NET web form (which are actually div tags since I can have only 1 form tag on the web form) , and I've applied the HTML required attribute on my input fields. Each form may be submitted independently, and I'd like the…
Fahad
  • 1,364
  • 3
  • 20
  • 40
0
votes
2 answers
0
votes
2 answers

HTML Validation API returns an empty object in Firefox

The validity property of an HTML input does not seem to work in Firefox. var input = $input.get(0); console.log(input.validity) This console log returns an empty object. It's working on Chrome and Safari and I think it's also suppose to work on…
user1834464