I have an input textbox and input keypad display on my webpage like in below image.
I have html code that takes digits from keypad to inputbox like below:
<div class="form-group">
<span class="demo_txt"><i>Demo Mode: Enter any 6 digit number </i></span>
</div>
<form id="patientAuthorize" Name="calc" method="post" novalidate>
<div class="form-group centered">
<input class="intxt" autocomplete="off" id="Phone" maxlength="6" name="display" type="tel" value="" placeholder="PIN"><button class="close-icon" type="reset"></button>
<input class="button button-orange" type="button" onclick="window.location.href='startinterview.html'" value="ENTER" style="width:100px">
</div>
<div class="calculator">
<!-- Screen and clear key -->
<div class="keys">
<!-- operators and other keys -->
<span OnClick="calc.display.value+='1'">1</span>
<span OnClick="calc.display.value+='2'">2</span>
<span OnClick="calc.display.value+='3'">3</span>
<span OnClick="calc.display.value+='4'">4</span>
<span OnClick="calc.display.value+='5'">5</span>
<span OnClick="calc.display.value+='6'">6</span>
<span OnClick="calc.display.value+='7'">7</span>
<span OnClick="calc.display.value+='8'">8</span>
<span OnClick="calc.display.value+='9'">9</span>
<span OnClick="calc.display.value+='0'" style="width: 166px;">0</span>
<span class="clear" OnClick="calc.display.value=''"> <div class="xBox">X</div></span>
</div>
</div>
</form>
I want to add symbols in textbox while user clicks some particular digits from keypad until some limit. e.g. if user has to type PIN number in textbox like 123-456 then after he clicks 1,2,3 from keypad '-' should automatically add after 123 in textbox and then user should allow to type remaining 3 digits.
I want this functionality for some formats like PIN (XXX-XXX), date (MM/DD/YYYY), phone number ((XXX)XXX-XXXX) etc.
I have checked Masked input plugin but it takes input from keyboard not from webpage keypad. Also user may not click on textbox first to start typing. User may directly click on buttons of webpage keypad to start typing.
How I can get above functionality for my webpage keypad? Can anyone please help me in this?
Thanks in adv.