Input filed for date and number


Below are codes for Automatically Open the Popup cookiealert. Please let me know your feedback.

Here is CSS code :

body{
background-color: #033366;
}
/* Chrome, Safari, Edge, Opera */
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* Firefox */
    input[type=number] {
        -moz-appearance: textfield;
    }

Here is the code for HTML :-

<html>
<head>
<title>Form input for date and number</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
<div class="container">
	<div class="row">
		<div class="col-md-12 mt-5">
			<h1 class="text-center" style="color:#ffff33;">INPUT Field For Date And Number Using Html</h1>
		</div>
		<div class="col-md-6" style="margin: 0 auto;">
			<div class="card mt-5">
			  <div class="card-body">
				<form>
				  <div class="form-group">
					<label for="exampleInputEmail1">Date</label>
					<input type="text" class="form-control" onfocus="(this.type='date')" onblur="(this.type='text')" id="date" placeholder="Enter Date of Birth">
					
				  </div>
				  <div class="form-group mt-3 mb-3">
					<label for="exampleInputPassword1">Phone</label>
					<input type="number" class="form-control" pattern="/^-?\d+\.?\d*$/" onkeypress="if(this.value.length==10) return false;" placeholder="Enter phone number">
				  </div>
				</form>
			  </div>
			</div>
		</div>
	</div>
</div>
</body>
</html>

 



0 Comment

Add a comment