For Number/Numeric Values in HTML (input type=”number”)

Example : How to Enter only Number values in html.
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Codershelpline</title>
    </head>    
    <body>
    	Enter only Number : <input type="number">    
    </body>
</html>     
Example : How to Enter only number values in between 10 and 100 in html.
<!doctype html>
<html>    
    <head>
        <meta charset="utf-8">
        <title>Codershelpline</title>
    </head>    
    <body>
    	Enter number between 10-100 : <input type="number" min="10" max="100">    
    </body>
</html>

<!-- NB : The given condition is valid with only pin button use, not by typing/copying/pasting in it.  -->
Example : How to enter only number values up to 10 digits in html.
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Untitled Document</title>
	</head>

	<body>
	   Mobile No. :<input type="number" 
           onKeyDown="if(this.value.length>=10)this.value=this.value.slice(0,-1);">	
	</body>
</html>
Example : How to increase the size of number box in html.
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Codershelpline</title>
	</head>
	<body>
	      <input type="number" style="font-size:30px">	
	</body>
</html>

For E-mail Values in HTML (input type=”email”)

Example : How to create e-mail box in html.
<!doctype html>  
<html>	
   <head>
      <title>Codershelpline Code of Typical Html Page</title>
   </head>
	
   <body>
      <form name="form1" id="form2" action="#" method="post">
	 <center>
	    <fieldset style="width: 600px">				
		<legend>Create New Student Account</legend>
		   <table name="tab1" id="tab2">			   
		      <tr>
		          <td>E-Mail</td>
			  <td>:</td>
			  <td><input type="email" name="em1" id="em2"></td>
		      </tr>			   
		      <tr>
			     <td></td>
			     <td></td>
			     <td><input type="submit" name="BtnSave1" id="BtnSave2" value="Save">
			     	 <input type="reset" name="BtnReset1" id="BtnReset2" value="Reset">                                 
			     </td>
		     </tr>
		   </table>
	       </fieldset>
            </center>
	 </form>
      </body>
  </html>

Loading

Categories: HTML

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.