Skip to main content
deckarduk
Inspiring
March 16, 2023
Answered

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

  • March 16, 2023
  • 1 reply
  • 515 views

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 has been closed for replies.
Correct answer try67

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 });
},

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 16, 2023

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 });
},

deckarduk
deckardukAuthor
Inspiring
March 16, 2023

Great!

Thanks for the speedy help Gilad 🙂