Default Values

Set default values and populate form fields from a database in ChronoForms.

Overview

The issue is not knowing where to set default values or how to populate fields with database data, such as a user's name after login.
Use the 'placeholder' or the 'Default Value' behavior for static defaults. To populate from a database, utilize the 'Default Value' setting with appropriate dynamic data retrieval.

Answered
ChronoForms v7
Sw SwingeyP 18 Jan, 2021
Hi all,

Q1. I want to populate some of my form fields with default values. I can't see where you do this.
It's just a simple text entry set with a mask for integer but I want it to default to 0 (zero).

Q2. Also. How can I populate a form field with a value from a database? _ The youtube examples show a table being populated with data but how do I populate one of my text fields with database data? The scenario is that a user logs in to Joomla. I then want to get the username and populate that in a field.

At present I have used some php to extract the username from Joomla as per the 'Name' in the screen shot but I want that data in 'What is your name'

Default Values image 1
Sw SwingeyP 18 Jan, 2021
Hi all. I have fathomed the default value using 'placeholder'

How can I add a value from a database variable to a text field? as above?
Max_admin Max_admin 23 Nov, 2024
Answer

use any value in your field's "Default value" setting which can be found in the Default Value behavior

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.