CGI scripts are server side programs that accept data input from the user and then can process this data. For example save data to a file, email the data.

 

Checkboxes or radio buttons become part of an array. So you must set them to the same variable name.

 

Radio buttons allow only 1 selection to be made

Checkboxes allow many choices to be selected

 

 

/cgi-bin/mail.cgi

 

onSubmit is used to verify a form. When the form is submitted some function is called to do the checking. A Boolean value is returned to say whether or not to allow the form to be processed.

 

 

selected=document.order.candy;        tempindex=selected.selectedIndex;

0 or greater if an item is selected

-1 if no selection

 

selected[tempindex].value
This will give me the value of the item selected

 

You could select a flag to check for errors in the form and set a variable with the error messages to give one big error saying what is missing in the form.