Skip to content Skip to navigation

Using Stanford Web Forms in Drupal websites

Stanford provides a flexible, easy-to-use web-based form service - a great free resource for site owners.  According to the Web Forms Service website:

"Stanford community members can use the Stanford Web Forms service to make contact forms, short surveys and polls, instructor evaluations, and other forms free of charge. No knowledge of HTML, Javascript, or SQL is required.

The form building application provides a selection of pre-formatted fields and elements, which makes it quick and easy to construct web forms. Data collected through the forms can be emailed to the form owner and/or stored in a MySQL database where it can be viewed through a secure web interface."

To learn more about Stanford Web Forms, sometimes know as formbuilder,  visit webforms.stanford.edu.

How do I create a Stanford Web Form?

  1. Visit formbuilder.stanford.edu
  2. Click on "Create New Form" and create your form.
  3. After creating your form, under the "Publish" tab, set the status to live.

How do I use the Stanford Web Form in a Drupal website?

You can embed your form into a web page using inline frames (iframe). On your Drupal website, embed your iframe into a text field such as the "body" field on a node. 

To embed the iframe in a text field:

  1. Turn off the WYSIWYG by selecting "Disable rich-text" or by selecting a text format that doesn't use a WYSIWYG (e.g., Plain text).
  2. Copy the web form URL from your live form or from the "Form URL"  field under the "Publish" tab in Form Builder.
  3. Replace the URL path in this HTML line of code with the  URL for your web form:
    <iframe src ="http://www.stanford.edu/dept/foo/myform.fb" width="100%" height="300"></iframe>
  4. On your website, paste the <iframe> HTML code into the text field of your content.
  5.  Save and test your form.

Troubleshooting:

  • If your site uses HTTPS, you'll need to change the URL in the iframe to use HTTPS as well.  It would look like this:
     <iframe src ="https://www.stanford.edu/dept/foo/myform.fb ....
  • If your web form doesn't appear immediately, wait a moment, it may still need a moment to load.
  • If it is still not showing up, it may be that the text format you are using doesn't allow iframe elements. Try using a different, more capable text format such as Full HTML.
  • If you need to configure your text formats to allow iframes on your Drupal 7 website visit:
    /admin/config/content/formats

More information

Categories: 

Comments

How do you select and set the AFS directory for the form you create?
If your form is just for you then use your personal space on AFS to host the form. However, if it is for a department or group,  you'll want to use the AFS Directory for your group or department. The url will look something like this:
 
If you need AFS space for your group, you can find directions for doing that at: