@ResearchInfo.com
Site Spnsors

To create a form field that allows for a short open-text response, you'll be working with Text Boxes. We recommend using 225 characters as the cut-off point between Text Box questions and Text Area questions.

To create this question...

3. How many times have you visited XYZ Company in the past year?

You would use the following code:

<p>3. How many times have you visited XYZ Company in the past year?</p>
  <p><input name="Q3" type="text" size="8" maxlength="3" / >
</p>

As with the other question types, the Text Box has a Name attribute that represents the data column you want the answers to be inserted into. There are two other optional attributes that can be used: Size and Maxlength.

The Size attribute controls only the physical appearance of how large the form field appears in the respondents' browsers. It's important to understand that different computing platforms display HTML elements differently. The Text Box, for example, will appear larger on a Macintosh computer than it will on a Windows computer.

The Maxlength attribute limits the total number of characters that a respondent is allowed to type into the Text Box. Note that we set the Maxlength attribute on this question to "3". If you scroll back up to where the question appears and place your cursor in the Text Box, you'll notice that the box only accepts 3 characters.

Return to Web Survey Tutorial index


Contact Scott Spain with Web site questions and feedback.

Site Sponsors: Venture Data and W3 Surveys

Thursday, August 7, 2008