This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

PreProcessor\LoadDefaultValues

Prefills form fields with configured values. Config is done for each step and for each form field. If you want to dynamically prefill a dropdown menu (e.g. from the database), refer to the section “How to fill your own markers via TypoScript”. The article contains a neat example about how to generate the “option” tags.

Version added

1.0.0

TypoScript path

plugin.Tx_Formhandler.settings.preProcessors.x copy to clipboard

Example code

preProcessors {
    1.class = PreProcessor\LoadDefaultValues
       1.config {
         
         #Prefill field in step 1
         1 {
            tile.defaultValue = {$local.mailform.title}
            lastname.defaultValue = Firstname in here
            firstname.defaultValue = TEXT
            firstname.defaultValue.value = Lastname in here
			email.defaultValue = TEXT
			email.defaultValue.data = GP:email
         }

         #Prefill field in step 2
         2 {
            creditcard.defaultValue = Enter your credit card number here
         }
       }
}

Properties

.defaultValue

Field will be filled with this default value string or the content of a cObject.

Data type

String | cObj

Default value

Version added

1.0.0