0

<script>

function datechecker()
	{
      /* Here,How can i display selected date*/
	}
</script>
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
		
<form method="POST" role="form" name="myform" enctype="multipart/form-data">
		<h2>Please select datey</h2>
		<input type="date" id="jsdate"  name="txtdate">
		<input type="submit" onclick="datechecker()" value="Check">
		</form>
</body>
</html>

Here I have defined input type=date to select date....and i want to display that selected date using javascript only....how can i do it??

1 Answer 1

1

function datechecker(){
/* Here,How can i display selected date*/
event.preventDefault(); // remove this line in your code.
console.log(jsdate.value);
}
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
		
<form method="POST" role="form" name="myform" enctype="multipart/form-data">
		<h2>Please select datey</h2>
		<input type="date" id="jsdate"  name="txtdate">
		<input type="submit" onclick="datechecker()" value="Check">


		</form>

</body>
</html>

Sign up to request clarification or add additional context in comments.

1 Comment

yes it is working ..and can i check that like..user must be 18 year old as on 01-05-2018...if it is possible than please provide me code for it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.