HTML forms are primarily used to enter information to be sent to the web server to be processed by a CGI program. JavaScript can be used with the forms to assist in data entry and validation.
This example request a date on a form. The default value is set using a JavaScript program that gets the date (from the client computer) and stores it in the form's date field:
Form object document.newcse.tdate.value includes:
document - page object
newcse - form object
tdate - form input field object
value - a property
This example uses JavaScript to set the date, change the items in the select box based on the college that is chosen, copy the sponsor's name, and finally validate the data before the form is submitted: