0

something about html form inputs

I have 2 question about it 1) what if ı want password to only be number and give it a limit (like 5 numbers) 2) what if I want dots in password to be * or # symbol. how can I make it happn https://code.sololearn.com/WinxIQ0ZnyKB/?ref=app

19th Apr 2022, 7:30 PM
Lalala
Lalala - avatar
4 Réponses
+ 2
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password You can specify pattern and maxlength to restrict input
19th Apr 2022, 7:42 PM
Lisa
Lisa - avatar
+ 1
For example this one allows only digits as password of length 5. Look at the pattern attribute. <input type= "password" name="password" placeholder=Password method="get" pattern="[\d]{5}"/>
20th Apr 2022, 2:54 PM
Lisa
Lisa - avatar
0
for number 1 you will need javascript to do that. for number 2 you will need also js but not recomanded, insted use php or python in django.
19th Apr 2022, 10:45 PM
Mohamed Ayaou
0
Lisa i didnt get why did code used for
20th Apr 2022, 2:48 PM
Lalala
Lalala - avatar