Add Today's Date to the Date Field with One Click
Contents
Overview
This sample inserts today's date into a Date field of your App with a click of a button.
To use this sample code, you will need a Date field and a Blank space field in your Kintone App.
A button will be displayed on the Blank space field, when you create a new record or edit an existing record.
Sample Image
To use this sample code, a Date field and a Blank space field is needed in the Kintone App.
A button is displayed on the Blank space field, when a user creates a new record or edits an existing record.
Prepare the App
Create an App with the following fields and settings.
Field Type | Field Name | Field Code / Element ID | Notes |
---|---|---|---|
Date | Date | mydate | |
Blank Space | - | myspace |
Sample Code
Prepare the following JavaScript code in a text editor and navigate to the Kintone App's settings. Upload the file into the Upload JavaScript for PC option of the JavaScript and CSS Customization settings .
|
|
After saving the settings and clicking on Update App, start creating a new record. A button should appear where the Blank space field is placed. Click the button to input today's date into the Date field.