context input
Context Input

How to use:
Client-side using exports
Example:
lvs_lib.openInput(heading, rows, options)heading:
stringrows:
string[]ortable(array)type:
'text'or'password'or'number'or'textarea'or'checkbox'or'select'or'slider'or'radio'or'date'
options?:
table(object)allowCancel:
booleanIf false the user will not be able to cancel and close the input dialog until submitted.
If not defined, the user is able to cancel and close the input dialog.
Field Type Properties
text / password
name:
stringlabel:
stringdescription?:
stringplaceholder?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
stringmin?:
numbermax?:
number
number
name:
stringlabel:
stringdescription?:
stringplaceholder?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
numbermin?:
numbermax?:
numberstep?:
number
textarea
name:
stringlabel:
stringdescription?:
stringplaceholder?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
number
checkbox / radio
name:
stringlabel:
stringoptions:
table(array)value:
stringlabel?:
stringdisabled?:
boolean
required?:
booleandefault?:
string
select
label:
stringoptions:
table(array)value:
stringlabel?:
string
description?:
stringplaceholder?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
string
slider
label:
stringplaceholder?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
numbermin?:
numbermax?:
numberstep?:
number
date
label:
stringdescription?:
stringicon?:
stringrequired?
booleandisabled?:
booleandefault?:
stringortrueTrue defaults to current date
format?:
stringDate format to display in the field
returnString?:
booleanReturns the date as a string, default format is
DD/MM/YYYY, but ifformatis defined it will use that.
clearable?:
booleanmin?:
string"01/01/2000"
max?:
string"12/12/2023"
The callback data is promise based meaning that the thread will not continue executing until the user either sends the data or exits the popup
Usage Example
local input = lib.closeInput('Dialog title', {
{name='field1', type = 'input', label = 'Text input', required = true, min = 4, max = 16},
{name='field2', type = 'number', label = 'Number input'},
{name='field3', type = 'textarea', label = 'TextArea input'},
{name='field4', type = 'date', label = 'Date input', format = "DD/MM/YYYY"}
})
print(json.encode(input))qb-input replacement
To replace qb-input with this script, you need to enable the functionality in the config.lua and remove a comment in the fxmanifest.lua
provide 'qb-input'--- ### CONTEXT INPUT ###
Config.InputAsQBInput = trueLast updated