LV Soft FiveM
  • LV SOFT
    • 👋Welcome!
    • 🛒Tebex
    • 💬Discord
  • QB/ESX
    • ☮️lvs-loading
      • Installation
      • Configuration
    • 👫lvs-multichar
      • Installation
      • Configuration
      • Adding Scenes
      • Tebex Integration
      • Commands
    • 🗺️lvs-spawnselector
      • Installation
      • Configuration
    • 🥼lvs-clothing
      • Installation
        • QBCore Install
        • ESX Install
      • Configuration
      • Migration
        • qb-clothing
        • esx-skinchanger
        • Illenium-Appareance
      • Blacklisting
      • Events
      • Commands
    • ⚙️lvs-lib
      • black-screen loading
      • notifications
      • progressbar
      • key-interaction
      • textui
      • alert
      • context menu
      • context input
    • 💬lvs-chat
      • Installation
      • Configuration
      • Events & Exports
    • 📱lvs-radio
      • Installation
      • Configuration
      • Events & Exports
    • 🗃️lvs-playerlist
      • Installation
      • Configuration
    • 📹lvs_weazelnews
      • Installation
      • Configuration
    • 🎒lvs-inventory
      • Installation
      • Configuration
      • lvs-inventory
        • exports
      • lvs-shops
        • Configuration
        • Exports
      • lvs-crafting
    • 🪪lvs-idmanager
      • Installation
      • Configuration
      • Exports
  • Standalone
    • 🚘lvs-drift
      • Installation
      • Configuration
      • Commands
    • 🕺lvs-animations
      • Installation
      • Configuration
      • Adding Animations
      • Exports/Events
    • 💥lvs-accident
      • Installation
      • Configuration
    • 🔥lvs-explosion
      • Installation
      • Configuration
    • 🏎️lvs-racing
  • ESX
    • 📅Soon
Powered by GitBook
On this page
  • Context Input
  • How to use:
  • Field Type Properties
  • Usage Example
  • qb-input replacement
  1. QB/ESX
  2. ⚙️lvs-lib

context input

Previouscontext menuNextlvs-chat

Last updated 1 month ago

Fontawesome is used to add icons to the list items, you can find the code here.

Context Input


How to use:

Client-side using exports

Example:

lvs_lib.openInput(heading, rows, options)
  • heading: string

  • rows: string[] or table (array)

    • type: 'text' or 'password' or 'number' or 'textarea' or 'checkbox' or 'select' or 'slider' or 'radio' or 'date'

  • options?: table(object)

    • allowCancel: boolean

      • If 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: string

    • label: string

    • description?: string

    • placeholder?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: string

    • min?: number

    • max?: number

  • number

    • name: string

    • label: string

    • description?: string

    • placeholder?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: number

    • min?: number

    • max?: number

    • step?: number

  • textarea

    • name: string

    • label: string

    • description?: string

    • placeholder?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: number

  • checkbox / radio

    • name: string

    • label: string

    • options: table(array)

      • value: string

      • label?: string

      • disabled?: boolean

    • required?: boolean

    • default?: string

  • select

    • label: string

    • options: table(array)

      • value: string

      • label?: string

    • description?: string

    • placeholder?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: string

  • slider

    • label: string

    • placeholder?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: number

    • min?: number

    • max?: number

    • step?: number

  • date

    • label: string

    • description?: string

    • icon?: string

    • required? boolean

    • disabled?: boolean

    • default?: string or true

      • True defaults to current date

    • format?: string

      • Date format to display in the field

    • returnString?: boolean

      • Returns the date as a string, default format is DD/MM/YYYY, but if format is defined it will use that.

    • clearable?: boolean

    • min?: 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

fxmanifest.lua (line 59)
provide 'qb-input'
config.lua
--- ### CONTEXT INPUT ###
Config.InputAsQBInput = true