John Davidson

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


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);
} elseif ($key == 'dob') {
$group[] = $this->form->createElement("date", $field, null);

My Answer:
date of birth in a web page:


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

5 of 5 based on 4881 votes


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