=================
on_field_get_html
=================
on_field_get_html(field)
**domain**: client
**language**: javascript
**class** :doc:`Item class `
Description
===========
Write an ``on_field_get_html`` event handler to specify the html that will be
inserted in the table cell for the field.
If the event handler does not return a value, the application checks if
the :doc:`on_field_get_text ` event handler is defined and it
returns a value, otherwise the :doc:`display_text `
property value will be used to display the field value in the cell.
The ``field`` parameter is the field whose
:doc:`display_text `
is processed. To get the item that owns the field, use the
:doc:`owner ` attribute of the field.
Example
=======
.. code-block:: js
function on_field_get_html(field) {
if (field.field_name === 'total') {
if (field.value > 10) {
return '' + field.display_text + '';
}
}
}
See also
========
:doc:`Fields `
:doc:`on_field_get_text `