Changes

Building Forms with JavaScript

172 bytes added, 19:33, 16 May 2007
The JavaScript Form Object
* '''action''' - the URL of the CGI script to which the data entered by the user will be sent. It is also possible to use ''mailto:'' to have the data sent to an email address.
 
* '''onsubmit''' - an optional function to call, or inline script to execute before the form data is submited to the server. This can be useful for validating user input.
The following is an example of a Form object named ''registerForm'' which submits the user data to a cgi script called register.cgi located in the /cgi-bin directory on the server which hosts the web site. The transfer is configured to use the GET method: