• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Autofill form plugin

  • Views Views: 27,195
  • Last updated Last updated:


         Form Article Plugin Tutorial
      Autofill form plugin
      Clone form plugin
      Comment form plugin
      Email form plugin
      EXIF form plugin
      FTP form plugin
      J2store form plugin
      Kunena form plugin
      Limit form plugin
      Logs form plugin
      Mailchimp form plugin
      Paginate form plugin
      Paypal form plugin
      PHP form plugin
      Pingdotfm form plugin
      Receipt form plugin
      Redirect form plugin
      REST form plugin
      Slack form plugin (+)
      SMS form plugin
      Twitter form plugin
      Upsert form plugin
      VBforum form plugin
      Create a Search Form
      Accordion Form Groups
  • The autofill plugin allows you to fill in fields based on a look up on a different list.

    Use appropriate field types. E.g. don't "fill" a calc element, it won't store the value but calculate your code.

    The data entered from the list is NOT dynamic, so if your form observers a user list, and you create a record autofilled in from the user 'John', and then later on you change that user's name to 'John Smith' then this form's record will still contain the value 'John'

    If you are looking for dynamic links between data you should be using List Joins


    • Connection - The fabrik connection that contains the lookup list
    • List- the Fabrik list that contains the data to insert into the form's Elements. This will usually be a different list, but it can be the same one your form is on, allowing you to select other row data from the same list to either base a new row on, or edit (see "Edit original Record" below).
    • Lookup field - A field in the lookup list. The autofill will return a record from the lookup list where this fields value matches the observed field's value.
      If left empty the plugin presumes that the record to use has a primary key value the same as the 'Field to observes' current value
    • Field to observe - the field which should contain the primary key of the list specified in the 'List' dropdown. If no trigger element specified, the autofill lookup will be performed when this element blurs or changes
    • Map data - a JSON object, where the key value is the lookup table's full element name, and the value a full element name of one of the current form's Elements. So in the image, data will be taken from 'countries___label' and placed in 'elementtest___name'

    • Trigger - If selected, this should be a Button element, when clicked the autofill lookup will occur
    • Edit original record - If set to yes, then when the auto fill lookup is performed and a match found the form's row id is changed to that of the matched record, meaning that you will edit the original record. NOTE - you should only ever set this to Yes if the list you are using to take the autofill data from is the same list your form is built on.
    • confirm - When the trigger element blurs or is clicked, do you want a confirmation box to appear asking the user if they want the fields to be auto-filled
    • Autofill on load - If creating a new record, and this option is set to yes then the autofill will be performed when the form is loaded. In addition trigger events will still be used

    Advanced map features​

    To fill fullname with both first name and last name from the lookup list:

    {"{h1qku_comprofiler___firstname} {h1qku_comprofiler___lastname}":"form_plugin_autofill___fullname"}

    In case of multiple fields to be updated you could add several mappings so that a multiple update could be perform in a single call. Just add all the mappings in the following form :


    Javascript Events​

    The plugin fires two events, fabrik.form.autofill.update.start and .end. The start event can be used to modify data before inserting it into the form. For example, if you are autofilling a field which has number formatting applied, you will need to manually format the data, because the string you get from autofill will not have the field's formatting applied. So you would create a ./components/com_fabrik/js/form_X.js file (where X is the numeric ID of your form), and do this:


    requirejs(['fab/fabrik'], function() {
    Fabrik.addEvent('fabrik.form.autofill.update.start', function(form, data) {
    data.table___element = Number(data.table___element).toLocaleString("es-ES", {minimumFractionDigits: 2});
    data.table___element_raw = data.table___element;

    Modify the table___element names to suite, and use the locale string you need.