John Davidson

javascript - Displaying the calculated age(in years) based on the entered 'Date of Birth' from the datePicker

0 comments
Message:


I want to get the value of the entered date from the datePicker in the current age field using PHP or Javascript in a PHP file.


    if ($key == 'currentage') {
$group[] = $this->form->createElement("text", $field, null, null);
$this->fieldNotRequired($field);
} elseif ($key == 'dob') {
$group[] = $this->form->createElement("date", $field, null);
$this->fieldNotRequired($field);


My Answer:
date of birth in a web page:

html



Age Calculator


Age Calculator












This code snippet creates a simple web page with an input field for the user to enter their date of birth. When the user clicks the "Calculate Age" button, the `calculateAge` function is called which calculates the age based on the entered date of birth and displays it on the web page.

Rate this post

3 of 5 based on 9077 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us