Edit online

URL Chooser Form Control

The oxy_urlChooser built-in form control is used for a dialog box that allows you to select the location of local or remote resources. The inserted reference is made relative to the URL of the currently open editor.

The oxy_urlChooser editor supports the following properties:
  • edit - Lets you edit the value of an attribute, the text content of an element, or Processing Instructions (PI). This property can have the following values:
    • @attribute_name - The name of the attribute whose value is being edited. If the attribute is in a namespace, the value of the property must be a QName and the CSS must have a namespace declaration for the prefix.
    • #text - Specifies that the presented/edited value is the simple text value of an element.
      Note: You can set the value of the visibility property to -oxy-collapse-text to render the text only in the form control that the oxy_editor function specifies.
  • columns - Controls the width of the form control. The unit size is the width of the w character.
  • width - Specifies the width of the content area using relative (em, ex), absolute (in, cm, mm, pt, pc, px), and percentage (followed by the % character) length units. The width property takes precedence over the columns property (if the two are used together).
  • color - Specifies the foreground color of the form control. If the value of the color property is inherit, the form control has the same color as the element that was used to insert it.
  • visible - Specifies whether or not the form control is visible. The possible values of this property are true (default value) and false.
  • fontInherit - This value specifies whether or not the form control inherits its font from its parent element. The values of this property can be true or false (default value). To make the form control inherit its font from its parent element, set the fontInherit property to true.
  • fileFilter - string value that holds comma-separated file extensions. The URL chooser uses these extensions to filter the displayed files. A value such as "jpg,png,gif" is mapped to a single filter that will display all jpg, png, and gif files.
  • hoverPseudoclassName - Allows you to change the way an element is rendered when you hover over a form control. The value is the name of a CSS pseudo-class. When you hover over the form control, the specified pseudo-class will be set on the element that contains the form control.
    p:before {
      content: oxy_urlChooser(hoverPseudoclassName, 'showBorder')
    p:showBorder {
      border: 1px solid red;
Example: oxy_urlChooser Form Control
urlChooser[file]:before {
    content: "A URL chooser editor that allows browsing for a URL. 
          The selected URL is made relative to the currently edited file:"
        edit, "@file",
        columns 25);
Tip: To insert a sample of the oxy_urlChooser form control in a CSS file (or LESS file), invoke the Content Completion Assistant by pressing Ctrl + Space (Command + Space on macOS) and select the oxy_urlChooser code template.

To see more detailed examples and more information about how form controls work in Oxygen XML Editor, see the sample files in the following directory: [OXYGEN_INSTALL_DIR]/samples/form-controls.

For more information about form controls, watch our video demonstration: