How can I have different prompts for the same field?

Answers to common Plum DEV questions

Moderators: admin, support

  • Author
  • Message
Offline

support

  • Posts: 3628
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

How can I have different prompts for the same field?

PostFri Jun 13, 2003 2:13 pm

The <prompt> tag's "count" attribute specifies how many times the user must have visited the form item containing a given prompt before it is played. E.g.

Code: Select all
<form id="form1">
  <field name="blah" type="digits">
    <prompt count="1">
      Please enter a number.
    </prompt>
    <prompt count="3">
      Using your telephone keypad, enter a number.
    </prompt>
    <filled>
      You entered <value expr="blah" />
    </filled>
    <catch event="nomatch noinput">
      <reprompt />
    </catch>
  </field>
</form>


In the above example (assuming the user provides no input or invalid input), the user will hear the following prompts in succession:

1 - Please enter a number.
2 - Please enter a number.
3 - Using your telephone keypad, enter a number.
4 or higher - Using your telephone keypad, enter a number.

Note that in the absence of a prompt whose count attribute exactly matches the number of the current iteration (in this example, 2, 4 or greater than 4), the prompt with the largest count attribute that is less than the number of the current iteration will be selected.

Return to Plum DEV FAQs

Who is online

Users browsing this forum: No registered users and 1 guest

cron