How You Can Use Dynamic Content

In addition to HTML, B2C Service supports the passing of specific JavaScript events to fields within web forms and surveys. This provides increased flexibility in personalizing the appearance and behavior of fields and questions as they are completed.

For example, an “onclick” event can be specified to dynamically enable a phone number field when a customer selects a check box indicating they want to be contacted by phone.

Supported JavaScript Events and Field Types

Event Field Types

onselect

Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.

onchange

  • Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.
  • drop-down lists such as country, province, or any custom field of type menu, date, or date time.

onblur

  • Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.
  • drop-down lists such as country, province, or any custom field of type menu, date, or date time.
  • Options and check boxes such as opt-in fields, or any custom field of type opt-in or yes/no.

onfocus

  • Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.
  • drop-down lists such as country, province, or any custom field of type menu, date, or date time.
  • Options and check boxes such as opt-in fields, or any custom field of type opt-in or yes/no.

onclick

  • Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.
  • drop-down lists such as country, province, or any custom field of type menu, date, or date time.
  • Options and check boxes such as opt-in fields, or any custom field of type opt-in or yes/no.

disabled

Text fields such as email, first_name, last_name, or any custom field of type text field, text area, or integer.