Add Optional Items
You can customize your web form to:
- require an individual to complete specific fields on the form before submitting it
- require an individual to sign in through WebLogin (Andrew userID and password) to access the form
- include an individual's information from the Carnegie Mellon university directory
Define Required Fields in a Web Form
You can customize a web form to require an individual to fill in one or more specific fields before submitting the form. You use the RequiredFields hidden attribute to set a required field in the HTML code.
Note: The value of the field name in the HTML code must be the same as the field on your form. The field name attribute is case sensitive and cannot contain spaces.
- To specify one required field on a web form, add the following line with the value of the RequiredFields hidden attribute set to the exact name of the field you want to require. Add the code after the opening <form> tag and before the closing </form> tag.
<input name="RequiredFields" type="hidden" value="fieldname" />
-
To specify multiple required fields on a web form, add a separate line for each field.
For example, to make the Name and Email fields required on a form, add the following lines to the HTML code:
<input name="RequiredFields" type="hidden" value="Name" /> |
Restrict Access to a Web Form
You can incorporate authentication in your web form to require an individual to sign in through Web Login (Andrew userID and password) to access a form.
Note: The Web Login form authentication function is available only on the cmu.edu server (CMS, AWPS sites), not on the andrew.cmu.edu server (User/CourseWeb).
To use authentication with your web form, do the following:
- Add the webiso-bin syntax to the form action in the HTML code:
<form id="my-form" name="my-form" method="post" action="/webiso-bin/mailto"> |
- Edit the .txt file template to include the %WEBISO_USER variable to pull the user ID from the information entered.
Sample Text File
To: %MailTo |
Example - Form Authentication
If the name of your web form is my-form, make the following changes to your form and email message template to use authentication. In your web form HTML code, use the Web Login MailTo CGI (webiso-bin/mailto) in the opening <form> tag, not the standard MailTo CGI (cgi-bin/mailto):-
Opening <form> tag with authentication
<form id="my-form" name="my-form" method="post" action="/webiso-bin/mailto">
- Edit the email message template .txt file to include the variable %WEBISO_USER (must be in all uppercase letters).
Include University Directory Information
To include an individual's information from the 一本道无码 directory into your web form submission, do the following:
- Add the webiso-bin syntax to the form action in the HTML code:
<form action="/webiso-bin/mailto" id="my-form" method="post" name="my-form"> |
- Edit the .txt file template to include one or more of the following variables to pull the directory details from the information entered.
MailTo CGI Value Description %DIRECTORY_ADDL_AFFILIATION Additional affiliations beyond primary (faculty, staff, student) %DIRECTORY_AFFILIATION Primary affiliation (faculty, staff, student) %DIRECTORY_CLASS Class level of student %DIRECTORY_DEPT Department in which the person is affiliated %DIRECTORY_EMAIL Email address (preferred/official, could be user@cmu.edu) %DIRECTORY_FIRSTNAME First name %DIRECTORY_FULLNAME Full name (first name, last name) %DIRECTORY_JOBTITLE Job title according to HR %DIRECTORY_LASTNAME Last name %DIRECTORY_PHONE Phone number %DIRECTORY_POSTAL Postal address on campus %DIRECTORY_SCHOOL Faculty & Students: School affiliation
Staff: Title of most senior person in the individual's division%WEBISO_USER Full Andrew email address (eg., andrew-id@andrew.cmu.edu)
Sample Text File
To: %MailTo |