Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Updated:</strong> JSFiddle with an example. (I am not the author)</p> <p>Here is a decent custom jQuery keypad to check out: <a href="http://jsfiddle.net/pjaaar/6Zh2V/" rel="nofollow">Simple jQuery Keypad</a></p> <p>HTML:</p> <pre><code>&lt;input style="background: white; color: black;" type="text" readonly="readonly" id="myInput"/&gt; &lt;table class="ui-bar-a" id="n_keypad" style="display: none; -khtml-user-select: none;"&gt; &lt;tr&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;7&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;8&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;9&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e" class="del"&gt;Del&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;4&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;5&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;6&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e" class="clear"&gt;Clear&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;1&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;2&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="numero"&gt;3&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e"&gt;&amp;nbsp;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e" class="neg"&gt;-&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="b" class="zero"&gt;0&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e" class="pos"&gt;+&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a data-role="button" data-theme="e" class="done"&gt;Done&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>JS:</p> <pre><code>$(document).ready(function(){ $('#myInput').click(function(){ $('#n_keypad').fadeToggle('fast'); }); $('.done').click(function(){ $('#n_keypad').hide('fast'); }); $('.numero').click(function(){ if (!isNaN($('#myInput').val())) { if (parseInt($('#myInput').val()) == 0) { $('#myInput').val($(this).text()); } else { $('#myInput').val($('#myInput').val() + $(this).text()); } } }); $('.neg').click(function(){ if (!isNaN($('#myInput').val()) &amp;&amp; $('#myInput').val().length &gt; 0) { if (parseInt($('#myInput').val()) &gt; 0) { $('#myInput').val(parseInt($('#myInput').val()) - 1); } } }); $('.pos').click(function(){ if (!isNaN($('#myInput').val()) &amp;&amp; $('#myInput').val().length &gt; 0) { $('#myInput').val(parseInt($('#myInput').val()) + 1); } }); $('.del').click(function(){ $('#myInput').val($('#myInput').val().substring(0,$('#myInput').val().length - 1)); }); $('.clear').click(function(){ $('#myInput').val(''); }); $('.zero').click(function(){ if (!isNaN($('#myInput').val())) { if (parseInt($('#myInput').val()) != 0) { $('#myInput').val($('#myInput').val() + $(this).text()); } } }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload