Message box with a text box

Here is how to show a message box with a text box.

Source Code

function myFunction() {
 var TextBox = Browser.inputBox('What is your name?');
 Browser.msgBox('Hello, ' + TextBox + '!');
}

Format

Browser.inputBox(text)

Parameters

text … A field title

How to show a message title?

Image;

Sample code;

function myFunction() {
 var name = Browser.inputBox('What is your name?', 'Full Name', Browser.Buttons.OK_CANCEL);
 var nation = Browser.inputBox('What is your nationality?', 'Nationality', Browser.Buttons.OK_CANCEL);
}

If you want to know a format & parameters, please refer the following post.

How to create a message box with a title

How to custom buttons?

Image;

Sample code;

function myFunction() {
 var name = Browser.inputBox('What is your name?', Browser.Buttons.YES_NO_CANCEL);
}

If you want to know a format & parameters, please refer the following post.

How to create a message box with buttons?

Leave a Comment