Search.../

prefix

Sets or gets the dashboard input prefix.

Description

You can get or set a prefix for a dashboard input element. For example, you can set a prefix to be a currency, such as '$'.

The following formats are supported:

  • A string literal, such as '$'
  • Vector images from the Media Manager: wix:vector://v1/<vector_uri>/<filename>
  • Vector images from the web: http(s)://<vector image url>
  • Vector XML strings: <svg>...</svg>

To disable the dashboard input prefix, set the prefix property to null.

Type:

stringRead & Write

Was this helpful?

Get the dashboard input prefix

Copy Code
1let prefix = $w('#myInput').prefix; // $
Set the dashboard input prefix to a string literal

Copy Code
1$w('#myInput').prefix = "$";
Set the dashboard input prefix to a vector image in the Media Manager

Copy Code
1$w('#myElement').prefix = 'wix:vector://v1/ce0334_2cec984ab68c490891dda1b53a33fead.svg/my-vector-graphic.svg';
Set the dashboard input prefix to a vector XML string

Copy Code
1$w('#myElement').prefix = '<svg height="10" width="10"><polygon points="0,9 9,9 5,0" style="fill:lime;stroke:purple;stroke-width:1"/></svg>';
Disable the dashboard input prefix

Copy Code
1$w('#myElement').prefix = null; // Disable the button's prefix property