Questions tagged [checkvalidity]

Part of the HTML constraint validation API.

Part of the HTML constraint validation API.

34 questions
77
votes
3 answers

html5 form checkValidity() method not found

I am trying to use the form method checkValidity(). http://html5test.com/ tells me that my browser (Chrome) support the form-level checkValidity method. However, using jsfiddle http://jsfiddle.net/LcgnQ/2/ I have tried the following html and…
Journeyman
  • 10,011
  • 16
  • 81
  • 129
5
votes
2 answers

HTML5 checkValidity says an empty input is valid

Given the following document: Without filling in the input, running: document.querySelector('input').checkValidity() Returns true. Since an empty input would not match [a-z], why is HTML5 checkValidity() returning true?
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
3
votes
3 answers

How to validate two check boxes and make sure that at least one is checked?

I have two check boxes in my form, all other form fields use HTML attribute required so I can run validation on submit. This is little different since I have two check box input fields and I have to require at least one to be checked. Here is an…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
3
votes
5 answers

Looping through array in if statement to check if all values pass

I have a variable 'fieldCount' that is equal to 5 (the number of fields I have). How can I write the following out without specifically stating each index: if ( fields[0].checkValidity() && fields[1].checkValidity() && fields[2].checkValidity() …
JordanBarber
  • 2,041
  • 5
  • 34
  • 62
3
votes
1 answer

Test/Validate SCORM objects?

I maintain a large (~5000 document) repository of educationally-useful works. I am already packaging them as ePubs and would like to package them as SCORM objects as well. I've added basic SCORM features the to epubs I'm generating, but I'm finding…
Proma
  • 111
  • 1
  • 6
2
votes
0 answers

HTML input validity initial state

Let me show some examples so you understand the problem clearly. ✔️ Exemple 1 : working as expected Consider an input and some css to visualize his validity. console.log( document.querySelector('input').checkValidity()…
Ssh-uunen
  • 313
  • 1
  • 9
2
votes
2 answers

Check if a URL is a video URL or PHOTO URL

I have a textview in which a user is supposed to enter a url. First I am checking the validity of the URL. Once the validity is confirmed, I need to check if It's a video url or photo url. I have two arrays of all possible video (MP4, MOV etc) and…
user9244459
2
votes
1 answer

Matching an input pattern beginning of script

I'm trying to match only GitHub URLs with the following input tag: In regex101 this exact pattern is matching all strings…
Adam McGurk
  • 186
  • 1
  • 19
  • 54
2
votes
1 answer

How to use check validity to validate a form with jquery

I'm trying to debug a snippet, so I can understand how it works the native javascript validation checkValidity(): Here's the problem: First I create an array of value and a form connected with a click…
Porcellino80
  • 447
  • 7
  • 32
1
vote
1 answer

Input type password validity patternMismatch status is different to regex test result

I have a regex to check whether a string contains at least one digit, one lower case, and one upper case character. (?=.*\d)(?=.*[a-z])(?=.*[A-Z]) This evaluates to true with test strings such as '1aA'. However the validity status of the…
Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
1
vote
1 answer

How to trigger HTML5 validation and set custom message on change event?

I have input text field that should allow only numeric values 0-9 and should be exactly eight digits long. This should be controlled by the onChange event. Once user is done typing validation should be triggered. If value is correct Ajax request…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
1
vote
0 answers

How to check license validity of another android application on google play

I have two applications on google play and I want make some benefits for people who owns both applications. Is there any way how can I check license validity of the second application? Thank you
user1063364
  • 791
  • 6
  • 21
1
vote
2 answers

enable/disable submit button based in input field (filled/not filled)

what I am missing in this code, If I just want the input submit button to enable/disable/enable.. as long as I fill or unfill the input text? sorry I am doing my best to learn javascript...can anyone help me fix this code?
1
vote
1 answer

Why does HTML5 checkValidity() return different results from JavaScript regexp.test()?

In JS, I can run: /[a-z]/.test('foo'); Which returns true, as a single lowercase character appears anywhere inside the string. However:
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0
votes
0 answers

Adding required to input type date doent work

I have a form with 4 inputs. I gave each of them "required" so the user will have to fill them in order to to finish the form. but it seems that even though I dont insert data to the input type date, it wont show the "this field is required". When I…
1
2 3