Skip to content Skip to site navigation

Doing More with Web Forms

Advanced fields

The first three fields below — name, email address and University ID — will auto-populate if the form is Webauth'd to the Stanford community.  See Restricting access to a form,below. Note: do not Webauth your form if you expect people outside Stanford, i.e., people without a SUNet ID and password, to use the form. You can also require that any of the fields be completed before the form can be submitted.  

  • Name
  • Email Address (only auto-populates if the visitor has made their email address visible in Stanford You)
  • University ID
  • URL
  • Survey 
  • Address 
  • Phone Number

To add an advanced field, select the Build tab and click on the field name. As mentioned above, you can specify in Edit mode that certain fields be auto-populated, and you can require input for any field. 

Exporting your data

You can download form data in Excel or CSV format:

  1. Log in to the Form Management screen of the Web Forms Service.
  2. Find the name of the form containing the desired data.
  3. If data is available for download, you'll see an active link in the Entries column (for example, 10 entries). Click the link. The Data Viewer opens.
  4. Under the name of your form, click Export your data in Excel Format (.xls) or Export your data in CSV Format (.csv).  The file will automatically download to your desktop.

Restricting access to a form

You can protect a form using Webauth by adding a file named .htaccess (this file starts with a period) in the AFS directory specified for the form. This is necessary if you want the name, email and University ID fields to autofill.

Location Examples

See the table below for examples of AFS paths corresponding to form URLs.

URL AFS Path /afs/ir/users/j/d/jdoe/WWW/.htaccess


See below for the example code to place in the .htaccess file. The following would protect the entire directory.

AuthType WebAuth
require privgroup stanford:stanford
# Add the following to auto-fill University ID
WebAuthLdapAttribute suUnivID

If you needed to protect just one form, you can do so by using the following code inside your .htaccess file, making sure you use the name of the form on the first line.

<Files "name-of-your-form-here.fb">
  AuthType WebAuth
  require valid-user

Giving form access to another person

See Adding and Removing Admins.

Using iframes to insert a form in a web page

To provide for a more seamless integration into your web site's design, choose the iframe style under the Style section of the Publishing tab. Then, add code similar to the example below to your web page:

<iframe src ="" width="100%" height="300" frameborder="0"></iframe>

You can adjust the height to make sure the form fits, or use JavaScript to size the iframe dynamically; see inline frames to learn about these and other settings.

Adding links and graphics

Using basic HTML, you can add graphics, links, etc. to your forms and surveys. HTML can be added in the text of most fields as you create your form. You cannot, however, incorporate HTML into field labels.

Last modified September 9, 2013