You can't add names to divs - names are only valid on form fields and are what the server side processing uses as the field names for the data that is passed to it.
There is no need to store any calculated value in a hidden field to pass it to the server as the server is going to need to recalculate it anyway for when the form is submitted by people without JavaScript.
You are right that you shouldn't be using prompt. The prompt() confirm() and alert() dialogs were repurposed after Netscape 4 dies and are now suitable for debugging use only. Some browsers add checkboxes to them to make their use for debugging easier as you can check the checkbox to disable the dialogs or JavaScript (depending on the browser).
document.write and document.writeln went out of use at the same time since innerHTML is able to update the page after it finishes loading .
Embedding any JavaScript in the HTML is now unnecessary as you can easily attach the event handlers from within the JavaScript code. For example get rid of the
onblur="age ()" form the HTML and add
Code:
document.getElementById('birthyear').onblur=age;
in the JavaScript instead.
Ideally you would wrap each JavaScript inside an anonymous function to reduce the chances of them interfereing with other scripts you might add to the page at a later time. To avoid the possibility of script clashes in trying to use the same event handler on the same element for different purposes you can substitute event listeners - but at the moment that involves slightly more code as IE8 and earlier use a different call to do it).
You can't submit a form to email using mailto: as modern browsers don't allow it - they will simply open the email program instead and ignore what was filled out in the form. You should use a form2mail script on the server instead to send the form to an email.