Documentation >> Custom Fields >> Edit Custom Fields
Editing Custom Fields
Custom fields have 'properties' which describe and define the field. Some of these properties are specific to a field type, and others are common to most or all of the field types.
The most common properties are those that describe the field item in a HTML form. These properties are also sometimes called "widget properties", becuase they describe only the user-interface element (widget), and are not used anywhere else.
Edit field properties on the Custom Fields page in the admin area of your conversation. The most common properties are listed at the top of the page, but you should keep in mind that some of these properties will be different for different field types. All of these properties correspond directly to attributes of an element tag in an HTML form.
Some field types, such as "Popup Menu" and "List/Combo Box" have other kinds of properties that will be available in a separate interface, further down the page. For more information on the properties associated with specific field types, see the Detailed Look at All Custom Field Types.
Field properties can also be specified in the macro which inserts the field into the page (such as msgCustomField or queryCustomField).
We're going to practice editing the properties of a custom field by changing our "Keywords" field. We're going to make it a litle bit wider, allow it hold more keywords, and we'll give it an ID so that it can be specifically referred to in JavaScript and Cascading Style Sheets.
- Open the Custom Fields Page
conversationURL/admin/conversations/convName/Custom%20Fields
- Click on Keywords
It's in the list of field names beneath "Select Field to Edit". Clicking on this link opens the field's property editor.
- Change Size to 50
This means the text-entry field in the browser will be 50 characters wide.
- Change MaxLength to 120
You'll be able to type up to 120 characters of text into the field, when editing a message.
- Change ID to MsgKeywords
Having a valid ID attribute in the tag makes it possible to write a style sheet that applies a style ONLY to this element. ID attributes can also be used in JavaScript to quickly get a reference to the item (such as with document.getElementByID() in modern browsers).
- Click on the Save button
This saves the changes to your field's properties, and reloads the same page so you can verify the changes you just made.
Now that you've changed the field properties, edit one of the messages in your conversation. You'll see that the Keywords field, which we added in a previous section, is now fifty characters wide instead of thirty, and allows you to type more text than it did before. Now look at the page's source (the HTML), and search for the word "Keywords". When you've found the tag for the keywords custom field, you'll notice that it also has an ID attribute like so: id="MsgKeywords" .
Custom field properties can also be specified in the macros that insert the field into a template. Properties in the macro will always override the "default" properties set in the admin area.
The names of the attributes that you can pass in the macros are identical to the names of properties that you can edit on the properties-editor page of the admin area. So, if your field type is "Short Text", the attributes that are recognized in the msgCustomField and queryCustomField macros are:
- Size
- MaxLength
- Class
- ID
- Style
- Title
- onFocus
- onBlur
- onChange
Here's an example of the msgCustomField macro with some of the properties set in the macro<
<!--#msgCustomField fieldName="Keywords" size="20" title="Related words, to aid in searching."-->
Please note that this is not a complete list of the attributes supported by the custom field macros! We're just showing that you can use macro attributes to override the custom field's properties. For more information on the attributes supported by the custom field macros, see the docs for the msgCustomField, msgCustomFieldProperty, and queryCustomField macros (you'll have to scroll down a ways to find the queryCustomField macro on that page).
View in DG
|