Skip to main content

Add a text input (:add_input)

Declaration

dialog_obj = dialog_obj:add_input(label [, default_value])

Parameters

  • label
    String. The label text shown on the left of the input
  • default_value
    String or Number. Default value in the input box

Returns

  • dialog_obj
    Dialog. Returns the dialog itself
  • :show() return type
    String. The entered text

Description

Add a text input to the dialog

Example

local c, s = dialog():add_input('An input', 'default'):show()
sys.alert('Entered: ' .. s['An input'])

Note: Uses function outside this chapter sys.alert

Full example

See :show()