1. The 3.8 code for Fabrik is now available on github, in the 'master' branch. If you are familiar with updating Fabrik from github, we would appreciate it if you could test this code on J! 3.8 for us. Once we have some feedback, we'll build a 3.8 release.

Set element defaults from URL

Dec 27, 2013
Set element defaults from URL
  • By defining a custom link for an Add button (to add a new record), you can alter one or more elements' default values by altering the URL's querystring.

    So presuming that your form's URL is:
    Code (Text):

    http://site.com/index.php?option=com_fabrik&view=form&formid=1
     
    and you have an element whose full name is 'mydata___name', to fill that element with the value 'Rob' you can alter the query string to be:
    Code (Text):

    http://site.com/index.php?option=com_fabrik&view=form&formid=1&mydata___name=Rob
     
    Note: For element's such as checkboxes, dropdowns or radio buttons, the value supplied in the querystring must be the value that is stored in the database and not the attached label. So say we have a checkbox whose full name is 'mydata_ok' and which has a single sub-option value = 1, label 'yes', our URL would be
    Code (Text):

    http://site.com/index.php?option=com_fabrik&view=form&formid=1&mydata___ok=1
     
ontarget and malucena like this.