How to disable the button until the field is not filled?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
15 views
How to disable (make it disabled) button until a field is populated in the code below?
Or tell me what to Google to check that the field is filled in accordance with the mask?

Contacts for transmission calculations This is the only mandatory field. It must be filled in (phone) to the engineer started the calculations, and we knew who to assign delivery options and their cost <!-- input -->
by | 15 views

3 Answers

0 like 0 dislike
For input that needs filling, add the required property, then the form is not sent until the field is full.
If it is necessary primarily to check the correctness of the, input is the pattern property, where the regular season need to register.
No need to make button disabled. After user clicks on the button you must send all completed for validation and tell the user error in filling.
by
0 like 0 dislike
if (phoneField.value.length > 5) { button.removeAttribute('disabled') }


\rhttps://jsfiddle.net/o8g66ocx/1
by
0 like 0 dislike
it is not necessary to honokowai...
take www.formvalidator.net or other similar
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users