Complete VBScript Reference
The InputBox function displays a dialog box, where the user can write some input and/or click on a button. If the user clicks the OK button or presses ENTER on the keyboard, the InputBox function will return the text in the text box. If the user clicks on the Cancel button, the function will return an empty string ("").
Note: A Help button is added to the dialog box when both the helpfile and the context parameter are specified.
Tip: Also look at the MsgBox function.
| Parameter | Description |
|---|---|
| prompt | Required. The message to show in the dialog box. Maximum length is 1024 characters. You can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13) & Chr(10)) between each line |
| title | Optional. The title of the dialog box. Default is the application name |
| default | Optional. A default text in the text box |
| xpos | Optional. The prompt box' distance from the left edge of the screen. Measurement unit: twips*. If omitted, the dialog box is horizontally centered. |
| ypos | Optional. The prompt box' distance from the top edge of the screen. Measurement unit: twips*. If omitted, the dialog box is vertically positioned one-third of the way down the screen |
| helpfile | Optional. The name of a Help file to use. Must be used with the context parameter |
| context | Optional. The Help context number to the Help topic. Must be used with the helpfile parameter |
A prompt box with a title:
A prompt box with a default text in the inputbox:
A prompt box wich is positioned 700 twips* from the left edge of your screen.
A prompt box wich is positioned 500 twips* from the top edge of your screen.
Complete VBScript Reference
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.