Carnegie Mellon University

Add Optional Items

You can customize your web form to require an individual to:

  • complete specific fields on the form before submitting it
  • sign in through WebLogin (Andrew userID and password) to access the 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" />
<input name="RequiredFields" type="hidden" value="Email" />

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, you must:

  1. Add the webiso-bin syntax to the form action in the HTML code:

<form id="my-form" name="my-form" method="post" action="https://www.cmu.edu/webiso-bin/mailto">

  1. 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
From: %WEBISO_USER
CC: %MailCC
Subject: Website Form Submission

The following person sent a website form submission from www.cmu.edu/my-site.

Name: %Name
Email: %Email
Phone: %Phone
Authenticated Andrew ID: %WEBISO_USER

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):
  1. Opening <form> tag with authentication

    <form id="my-form" name="my-form" method="post" action="https://www.cmu.edu/webiso-bin/mailto">

  2. Edit the email message template .txt file to include the variable %WEBISO_USER (must be in all uppercase letters).