Skip to content Skip to 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 .htaccess file 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
https://web.stanford.edu/~jdoe/form.fb /afs/ir/users/j/d/jdoe/WWW/

https://web.stanford.edu/dept/foo/form.fb

/afs/ir/dept/foo/WWW/

See the example code, below.

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

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 ="http://web.stanford.edu/dept/foo/myform.fb" 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.

More

Additional topics are covered in the Web Forms FAQ.

Last modified September 9, 2013