0

Those who marked this as duplicate please review and answer me ! Because here my scenario is totally different from other ! I'm not having a HTML website! I'm having ASPX web page application! So if I set type="number" or "tel" its not running! Because there is no such attribute in ASPX page tag. I'm using only allowed! So those previous answers for HTML page only I can use type="number" or "tel". Please try in ur local environment. Because try this code <input type="number" runat="server" id="numberonly"/> or <input type="tel" runat="server" id="numberonly"/> but this will work if we didn't use runat="server" attribute like this

<input type="number" id="numberonly"/>

But I want with runat="server" because I'm taking those parameter to back-end like getting value of field like .value ! So please help me to do this in client side itself.

I have searched a lot of content to show only numeric keyboard, when they call my aspx web page from a android or a iPhone or both... In HTML5 i have the type attribute number to achieve this but my problem is I'm having a mobile site page on ASPX web page.

The code <input type="text" id="txtnumber" value="Numberonly" pattern="[0-9]*" /> Was not working! So i want to define a attribute number so that i can use that on <input type="number" please can any one help? I already tried type="tel" also!

joao2fast4u
  • 6,868
  • 5
  • 28
  • 42
Anto king
  • 1,222
  • 1
  • 13
  • 26
  • Try `` BUT do not think you can do that on a website. Try to at least make a javascript for the field to accept only numbers. – PiLHA Jun 07 '13 at 11:03
  • We can set a type attribute dynamically by using javascript for input type=number. code will be look like this function setTypeNumeric() { document.getElementById('<%=txtnumber .ClientID%>').type = 'number'; } $(document).ready(function () { setTypeNumeric(); }); I've answered my own question but because of its marked as duplicate i cant get reputation. Thanks guys!!! – Anto king Jun 10 '13 at 13:44

0 Answers0