0

Sorry I'm new to programming and I trying to understand this. I tried to create this input form for phone numbers that only accept numbers and lengths between 10 to 11.

I tried <input id="text" type="number" minlength="10" maxlength="11" name="staff_phone" value="<?php echo $s_phone ?>">. I can only input numbers but the length are not limited.

I found some solutions online, by changing the type to tel <input id="text" type="tel" minlength="10" maxlength="11" name="staff_phone" value="<?php echo $s_phone ?>">. Now the length is limited but now I can input alphabets inside.

Can I know what's the way to have both limitations together? Thank you in advance.

0 Answers0