Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In html there is no way to set a maxLength on a textarea control. This is why the textarea control does not have a maxlength property like the text control does. It is possible to do this via a business rule. This example form has a textarea control named 'Desc' where the user can enter up to a 500 character description. On this control we also set the ErrorMsg property to the string 'You must limit your description to 500 characters'. This message is automatically displayed when the description control is set to invalid by the following business rule.

Code Block
languagejavascript
if (Desc.value.length > 500) {
  Desc.valid = false;
} else {
  Desc.valid = true;
}

You can even customize the error message by adding this line to your rule. Now the error message will tell the user how many characters they are over the maximum allowed.

...

Code Block
if (product.value.length > 0) {  
    size.value = null; 
}

Default Option

When your options are set dynamically as shown below in a business rule, you cannot set a default in on the form designer. You need to set the default in the rule. If your options have <value>=<label> where value is different from label, make sure you set the <control>.value to <value> not <label> and not <value>=<label>

...

Code Block
if (colorPalette.value.length > 0) 
{ 
    colorChoice.value = 'Thank you for choosing colors'; 
} 
else 
{ 
    colorChoice.value = 'Please choose colors...'; 
}

Checkbox Options - Making a Control Visible/Invisible Based on Checkbox Choices

...