+ 4

how when a user enters input at least 4 characters the button will be active using javascript / jquery

https://code.sololearn.com/WMAYLh4imt3R/?ref=app

22nd Apr 2019, 3:11 PM
Avirur Rahman
Avirur Rahman - avatar
10 Antworten
+ 1
https://code.sololearn.com/Wyw1KDeuXAKU
23rd Apr 2019, 9:25 AM
Sarbudeen
Sarbudeen - avatar
+ 5
Kartik Krishnan thanks too👍
23rd Apr 2019, 11:01 AM
Avirur Rahman
Avirur Rahman - avatar
+ 4
that is to say, give me an example
23rd Apr 2019, 8:46 AM
Avirur Rahman
Avirur Rahman - avatar
+ 4
Sarbudeen thanks👍
23rd Apr 2019, 10:59 AM
Avirur Rahman
Avirur Rahman - avatar
+ 3
I mean the button is disabled when the user enters a minimum of 4 characters, the button changes to active
23rd Apr 2019, 8:12 AM
Avirur Rahman
Avirur Rahman - avatar
+ 3
Sarbudeen see my code the button is still disabled
23rd Apr 2019, 8:37 AM
Avirur Rahman
Avirur Rahman - avatar
+ 1
<input type="text" minlength="4" required>
23rd Apr 2019, 7:47 AM
Sarbudeen
Sarbudeen - avatar
+ 1
<input type="text" id="name" required> <input type="submit" id="button"> <script> $("#name").keyup(function (){ var len=this.val().length; $("#button").attr("disabled",true); if (len>=4){ $("#button").attr ("disabled",false); } else { $("#button").attr ("disabled",true); } }); </script>
23rd Apr 2019, 8:25 AM
Sarbudeen
Sarbudeen - avatar
+ 1
Check the current update
23rd Apr 2019, 8:43 AM
Sarbudeen
Sarbudeen - avatar
23rd Apr 2019, 9:27 AM
Kartik
Kartik - avatar