Q: What is a Web form?
A: A Web form is a way for someone browsing your Webpage to send
information to the Web server. There is a small program (script) running on the server that collects the information. The script provided by Web Services takes that information and sends it to a specified address in the form of an e-mail.
Q: How do I include a Web form on my page?
A: To put a form on your page, you need to edit the HTML source code. This
is the HTML code for a minimal form that can be handled by the script provided by Web Services:
<form action="http://www.sjsu.edu/cgi-bin/mail_form.pl" method="post">
<input type="hidden" name="TO" value="your e-mail address" />
<input type="hidden" name="SUBJECT" value="your e-mail subject" />
<label>Last Name:</label>
<input type="text" name="LNAME" />
<br /><label>First Name: </label>
<input type="text" name="FNAME" />
<br /><label>E-mail Address: </label>
<input name="FROM" type="text" size="60" />
<br /><label>Comments:</label><br />
<textarea name="COMMENTS" cols="50" rows="4"></textarea>
<br />
<input name="Submit" value="Submit form" type="submit" />
<input name="Reset" value="Reset form" type="reset" />
</form>
Items in italics should be replaced with your own information.
Q: What is a required field?
A: A required field is one that must have a value entered into it by the user in order for the form to be accepted. If a required field is left blank, the person who submitted it will see a message indicating which field(s) need to have values. The following fields are always required:
Q: Can I add other fields?
A: Yes, you can add as many additional fields as you want. See the field types for more details.
Q:What field types are available?
A: The following are the types of field you may use, including an example and the HTML code that created it.
Q: How do I make a custom field required?
A: To make a text field required, give it a name that ends with '*'.
Q: What happens after the form is submitted?
A: A program on the Web server gathers the form data and composes an e-mail which is sent to the specified addresses.
The person who submitted the form sees a confirmation page. The confirmation page can be customized.
Q: Does the person who submitted the form receive an e-mail?
A: By default, the person who submitted the form will only see a confirmation Web page. If you would like the submitter to also receive a copy of the e-mail, you can make a request to the Web Services Unit to add your form to the list of forms with that capability.
Q: Can I "reply" to the e-mail?
A: By default, you cannot reply to the e-mail. In order to guarantee that e-mail will not be "dropped" by the mail server due to an invalid FROM address, the form handler on the Web server substitutes "do-not-reply@sjsu.edu" as the FROM and REPLY-TO address. If you would like the ability to reply to the e-mail, you can add this line to the form on your Web page:
<input type="hidden" name="use_senders_return_address" value="true" />
Note: If you add this line to your form, it is possible that some e-mails (those with invalid FROM addresses) will be lost.
Note: CSTART and CEND can be used separately or together. CCONFIRM can only be used by itself.
Q: How do I get the form data?
A: The data will be sent to you in an e-mail.
Q: Can I have the form data sent to more than one person?
A: Yes, submit a request to Web Services that includes the e-mail address(es) you want the data sent to. We will provide you with a hash code that can be used in the "STO" (Secure TO) field instead of TO field. This has the additional benefit of hiding the e-mail address from "spammers".
Q: Can my e-mail address be hidden?
A: Yes, use the STO field. Submit a request to Web Services with the e-mail address you want to hide. We will provide you with a code that can be used in the STO field to replace your actual address in the TO field.
Q: How can I make my forms more accessible?
A: In order to make forms more accessible to people using assistive technology, such as screen readers, you should associate each field with its label. To do this, use the "for" attribute of the label tag to match the "id" attribute of the input tag.
For example:
<label for="lname">Last Name</label><input type="text" name="last_name" id="lname" />