form_input as only numeric in CodeIgniter
<p>I'd like to change the type of input field from text to numbers only.I've tried as following</p>

<pre><code>&lt;?= form_input('num', '','class="form-control" id="num", type="number"');?&gt;
</code></pre>

<p>but not working</p>