I would like to initiate a default value for a specific field that I can change when I am in the record.
What is the best method to do that ? directly in the database or in PHP ? how to do that also to put the today's date by default ? I have tried several methods without success unfortunately. Many thanks for your help
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
What is the best method to put default in a field ?
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: What is the best method to put default in a field ?
Hi,
To set a default value, use JavaScript in the form's Custom Code:
Automatic Initialization and Updating for TIMESTAMP and DATETIME
TIMESTAMP and DATETIME columns can be automatically initializated and updated to the current date and time (that is, the current timestamp).
For any TIMESTAMP or DATETIME column in a table, you can assign the current timestamp as the default value, the auto-update value, or both:
An auto-initialized column is set to the current timestamp for inserted rows that specify no value for the column. Read more...
To set a default value, use JavaScript in the form's Custom Code:
From the mySQL Reference:how to do that also to put the today's date by default
Automatic Initialization and Updating for TIMESTAMP and DATETIME
TIMESTAMP and DATETIME columns can be automatically initializated and updated to the current date and time (that is, the current timestamp).
For any TIMESTAMP or DATETIME column in a table, you can assign the current timestamp as the default value, the auto-update value, or both:
An auto-initialized column is set to the current timestamp for inserted rows that specify no value for the column. Read more...
You do not have the required permissions to view the files attached to this post.