Skip to main content
deckarduk
Inspiring
Mar 16, 2023 9:03 AM UTC
Answered

Help with a custom dialog 'edit_text' question please...

Hi there,

I have a custom dialog with an edit_text field on it.

Is it possible to load the field with some default text?

Thanks in advance.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 16, 2023 9:07 AM UTC

Yes, using the initialize method of the dialog object. Let's say it's called "txt1". You can use this in your object definition:

 

initialize: function (dialog) {
// Create a static text containing the current date.
var todayDate = util.printd("mmmm dd, yyyy", new Date());
dialog.load({ "txt1": todayDate });
},

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Mar 16, 2023 9:07 AM UTC

Yes, using the initialize method of the dialog object. Let's say it's called "txt1". You can use this in your object definition:

 

initialize: function (dialog) {
// Create a static text containing the current date.
var todayDate = util.printd("mmmm dd, yyyy", new Date());
dialog.load({ "txt1": todayDate });
},

Translate
deckarduk
deckardukAuthor
Inspiring
Mar 16, 2023 9:10 AM UTC

Great!

Thanks for the speedy help Gilad 🙂

Translate