Skip to main content
Known Participant
December 13, 2018
Answered

Check Box

  • December 13, 2018
  • 2 replies
  • 1620 views

Hi,

I'm a beginner of JavaScript.

Does anyone know, how to create a checkbox with some text. I've tried this below script, but it was not work.

var myDialog = app.dialogs.add ({name:"sample"});

with (myDialog.dialogColumns.add())

{

    var myCheckBoxField = checkbox.add ({"ABC"});

    }

var myResult = myDialog.show ();

Regards,

KPS

This topic has been closed for replies.
Correct answer Manan Joshi

Hi Karuppasamy,

Try the following

var myDialog = app.dialogs.add ({name:"sample"});

with (myDialog.dialogColumns.add())

{

     var myCheckBoxField = checkboxControls.add ();

     myCheckBoxField.staticLabel = "ABC"

}

var myResult = myDialog.show ();

-Manan

2 replies

Trevor:
Legend
December 13, 2018

Unless you have a good reason you should probably use SUI instead of app dialogs.

They are easier to work with.

Peter Kahrel has a good guide to them.

ScriptUI for dummies | Peter Kahrel

There's also a chapter in the tools kit guide. There's a link to the guide in the help menu of the ESTK (if that's still working by you:)

Manan JoshiCommunity ExpertCorrect answer
Community Expert
December 13, 2018

Hi Karuppasamy,

Try the following

var myDialog = app.dialogs.add ({name:"sample"});

with (myDialog.dialogColumns.add())

{

     var myCheckBoxField = checkboxControls.add ();

     myCheckBoxField.staticLabel = "ABC"

}

var myResult = myDialog.show ();

-Manan

-Manan
Known Participant
December 15, 2018

Hi Manan,

Thank you so much

It's working perfect!