50 questions
-1
votes
1
answer
293
views
Java Jakarta Custom Constraint Validator not invoked
I have created Custom ContrainValidator and added the code below.
I have also added my controller class. Somehow code is not flowing in the validator.
ValidCustomClass class
package com.validation;
...
0
votes
2
answers
85
views
How can add iteration to my form validation error function?
I am new to programming and am trying to build this form validation function to check the validity of different input types and throw relevant errors. The part I am struggling with is incorporating ...
0
votes
0
answers
55
views
Default Invalid Message displaying first
below is a snippet of code I'm having issues with. I'm new to JS but the idea was to validate against input entered into a form. I got everything fine but eventually wanted to introduce the idea that ...
0
votes
1
answer
141
views
Safari datetime-local form validity bug after unsetting value
Using the following form in Safari, if you set a date and then use the "clear" button to unset it, Safari will invalidate the form even though it's valid.
It also doesn't assign the input ...
1
vote
0
answers
84
views
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 ...
-2
votes
1
answer
1k
views
How to get the text from mouseover popup element using Selenium Webdriver [duplicate]
I am trying to get the text of the mouseover on the login page from the email field.
This is the site "https://app.involve.me/login/?_ga=2.49216998.1374332121.1660294616-36640509.1660294616"
...
0
votes
2
answers
592
views
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....
1
vote
1
answer
2k
views
Why does checkValidity or reportValidity triger automatic submit of a form in jquery?
Consider the following code:
$("button[type='submit']").click(function(e){
if($(this).closest("form").checkValidity()) {
$(this).closest("form").reportValidity();
...
3
votes
1
answer
4k
views
Why are custom validation messages causing my HTML form elements to stay invalid?
I've implemented a custom validation message on my input for the pattern validation rule while leaving the default message for required as is. However, when I do so, once the input becomes invalid, it ...
3
votes
1
answer
1k
views
Angular: using browser's HTML native build in validation error messages
Is there a way to use browser's native HTML validation error messages and use them in angular way?
what I would like is to when having like a reactive form like this:
testForm: FormGroup = this.fb....
0
votes
1
answer
4k
views
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 ...
1
vote
2
answers
248
views
Is there a way to copy validation from one input to another with JavaScript?
I have a client who wants me to punctuate all currency inputs with commas and dollar signs. This means that I have to use a text input instead of a number input, which means that I cannot take ...
2
votes
2
answers
3k
views
Can you call checkValidity() on a <form> element?
I was looking through the Constraint Validation API and found some example code online that seemed to call checkValidity() on <form> elements:
(function() {
'use strict';
window.addEventListener(...
0
votes
2
answers
4k
views
How to verify login text box validation error message using Selenium [duplicate]
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 ( ...
2
votes
1
answer
1k
views
HTML validation constraints - setCustomValidity and novalidate
I'm struggling with the HTML5 native form validation. My understanding from Client-side form validation is you can manually set the validity state of an element with setCustomValidity(). However, this ...
0
votes
1
answer
764
views
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 ...
16
votes
1
answer
2k
views
iOS Safari 13: Default validation bubble messages are not properly aligned
We're using HTML5 form validation without overwriting the default system UI for the validation error messages. This is working fine everywhere but on iOS Safari, where the validation messages are not ...
1
vote
4
answers
4k
views
How to enter numeric value in input field using Python Selenium?
I've got a script writing values into a web page, and all values write except for one field that keeps throwing up the following error:
(Screenshot provided b/c in other similar questions many ...
0
votes
1
answer
54
views
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.
<input class="testclass" type="date" min="2020-02-01" max="2020-03-01"/>
The control can sometimes be loaded via ajax and there ...
4
votes
1
answer
2k
views
custom web component form element for constraint validation
Only some HTMLElements support the constraint validation api (e.g., HTMLButtonElement). I want to create a custom web component, which also supports the constraint validation api.
In the following an ...
3
votes
2
answers
997
views
HTML5 constraint validation for custom check
I would like to check if username and email address is unique on client side.
Is there any way to add custom validation for constraint validation?
Or is there any other recommended way for this?
I ...
0
votes
3
answers
799
views
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 "[email protected]" 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 ...
2
votes
1
answer
923
views
How to validate html5 constraint validation message using Selenium-Webdriver and Java [duplicate]
How do I validate the following message? The required class has the floating message.:
try the following, but I get the error "no such alert"
package firsttestngpackage;
import org.openqa.selenium....
3
votes
3
answers
4k
views
How to handle HTML constraint validation pop-up using Selenium?
After click on the "LOG IN" button, a "Please fill out this field." pop-up message appears.
I want to get the text of this pop-up message by using Selenium. Is it even possible?
...
1
vote
1
answer
1k
views
Screen Reader and HTML validation
Using HTML5 validation and screen readers, is there a way to make the screen reader read the HTML validation message?
<form>
<input type="email" required="required">...
0
votes
2
answers
351
views
How can I extract the text of HTML5 Constraint validation in https://www.phptravels.net/ website using Selenium and Java? [duplicate]
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 ...
0
votes
1
answer
531
views
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 ...
2
votes
2
answers
1k
views
How to include custom field validation function in HTML form validation?
I have custom password validation function in my form. On the same form I use HTML5 validation on all other fields. I'm wondering if there is a good way to include this function in HTML validation? ...
11
votes
1
answer
9k
views
How to find which child element is invalid in an HTML form
Is there a way to find which child elements in the form is invalid using the html5 automatic form validation?
I know we can check element by element, by calling checkValidity() method. What I'm ...
0
votes
0
answers
836
views
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 ...
0
votes
2
answers
189
views
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 ...
2
votes
1
answer
5k
views
How to run HTML validation with onClick JQuery function?
I'm trying to implement HTML validation in my project. Seems very helpful and easy for use. However this validation will work only if input type is set to submit. That part is causing problem for me. ...
2
votes
0
answers
1k
views
Validation message not showing on invalid field if the field is off screen during form submission
I want to leverage HTML5Constraint Validation for a registration form. I have a large number of inputs, and due to this, the submit button is not on screen at the same time as some of the required ...
2
votes
2
answers
971
views
Can I make different browsers show HTML form error messages the same way?
I have created a login form with username and password fields. Username should be a a text filed with type email and password will be a text filed with type password which need to satisfy a regex ...
-1
votes
1
answer
1k
views
Which event causes browsers to show HTML validation messages?
I'm trying to understand why I can't get browser validation error messages to show based on HTML validation.
I have a field in my markup that I want to validate, and a link that investigates its ...
1
vote
0
answers
172
views
Are there any disadvantages to overwriting HTMLInputElement.checkValidity?
I want to create custom validity rules for HTML input elements (or polyfill unsupported ones). To blend as well as possible into the browser's native validation procedure, I came up with overwriting ...
0
votes
0
answers
634
views
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 ...
2
votes
1
answer
165
views
Any workaround of Opera 12's input type=number validity behavior?
I was just troubleshooting an issue with a library of mine but it boils down to being something related with Opera behavior. Now, I haven't found big warnings anywhere on this issue, so my guess is ...
1
vote
1
answer
860
views
How to show a custom validation message with pattern validation for email
I want my HTML form to show a custom error message when an email address is not in correct format
<form>
<input type="text" pattern="^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9]...
0
votes
2
answers
1k
views
How to make HTML validation work with onclick="form.submit()" instead of a type="submit" button/input
I have a form with the following code:
<form name="form" method="post" action="https://pilot.datatrans.biz/upp/jsp/getCcAliasFormMod.jsp" id="form_payment_cc"...
0
votes
2
answers
374
views
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 ...
6
votes
1
answer
4k
views
How to call HTML5 form.checkValidity during form.onSubmit in WebForms?
How can i override, or extend, the standard WebForms WebForm_OnSubmit JavaScript function?
I am using HTML5 input types in an ASP.net WebForms web-site. The user-agent (e.g. Chrome, IE, Firefox) ...
17
votes
5
answers
30k
views
Manually trigger HTML validation on button click
I am trying to handle form validation on button click. It is validating the form but not showing error.
can anyone help me in this?
<form id="the-form" action="#">
<...
31
votes
4
answers
55k
views
How to manually show an HTML validation message from a JavaScript function?
I want to know if there is any way to programmatically show a HTML validation error, using a JavaScript function.
This is useful for scenarios where email duplication has to be checked. For example, a ...
13
votes
3
answers
6k
views
How do I detect an attempted submission of invalid HTML forms?
When using HTML form validation, having an invalid input value in a form will halt submission of that form. How can I detect that the user attempted a failed form submission? The form's onsubmit ...
5
votes
1
answer
4k
views
HTML Validation: Using element.validity.typeMismatch and element.validity.tooLong
I have a JavaScript validation framework that I've created and I'm trying to add HTML validation to it. In my framework, validation is accomplished by binding validation-constraints to elements using ...
1
vote
1
answer
646
views
How can I fix these setCustomValidation unbind issues with my jQuery code
I am using the built-in HTML validation methods to validate the date of birth in a form.
The form has three select list elements:
user_dob_date
user_dob_month
user_dob_year
All three elements have ...
24
votes
5
answers
14k
views
Check if a browser has built-in HTML form validation?
How to check if a browser has built-in HTML form validation ability? By doing so, we don't need to apply jQuery form validation functions on browsers who can validate form by themselves.
36
votes
6
answers
47k
views
How can I void a form action and execute jQuery when all HTML form elements are validated?
I have a simple HTML form that I want to leverage for required field validation. My issue is that I want to use the HTML5 form validation BUT at the same time avoid actually submitting the form ...
461
votes
19
answers
882k
views
How to set custom validation messages for HTML forms?
I've got the following HTML form: http://jsfiddle.net/nfgfP/
<form id="form" onsubmit="return(login())">
<input name="username" placeholder="Username" required />
<input name="pass" ...