LogoLogo
Discord
  • Project Sponsors
    • ✍️JetBrains
    • 📚GitBook
    • 🗃️Pleb Masters: Forge
    • 🎥KakarotDevs
  • Guides
    • 🪟Windows Installation
    • 🐧Linux Installation
    • 🔓Setting Permissions
    • 🚀Script Optimization
    • 📑Miscellaneous Guides
    • 📝Visual Studio Code
    • 🔗Useful Links
  • QB-Core
    • Core Object
    • 📊Player Data
    • 📜Shared
    • ↗️Shared Exports
    • 💬DrawText
    • 🎮Client Event Reference
    • 🎮Client Function Reference
    • 🖥️Server Event Reference
    • 🖥️Server Function Reference
    • ❗Commands
  • QBCore Resources
    • 🔧qb-adminmenu
    • 🚑qb-ambulancejob
    • 🏨qb-apartments
    • 🏦qb-banking
    • 💰qb-bankrobbery
    • 🚌qb-busjob
    • 🏢qb-cityhall
    • 👕qb-clothing
    • 🪙qb-crypto
    • 🤿qb-diving
    • 🚪qb-doorlock
    • 💊qb-drugs
    • ⌚qb-fitbit
    • ⛽qb-fuel
    • 🚘qb-garages
    • 🚛qb-garbagejob
    • 🌭qb-hotdogjob
    • 🔫qb-houserobbery
    • 🏡qb-houses
    • ℹ️qb-hud
    • 📝qb-input
    • 🏠qb-interior
    • 🎒qb-inventory
    • 💎qb-jewelry
    • 🏁qb-lapraces
    • 🔃qb-loading
    • 👔qb-management
    • 🧑‍🔧qb-mechanicjob
    • ↖️qb-menu
    • qb-minigames
    • 🙋qb-multicharacter
    • 📰qb-newsjob
    • 🤑qb-pawnshop
    • 📱qb-phone
    • 👮qb-policejob
    • 🔐qb-prison
    • 🔄qb-radialmenu
    • 📻qb-radio
    • ♻️qb-recyclejob
    • 📋qb-scoreboard
    • 🔋qb-scrapyard
    • 🏪qb-shops
    • 📚qb-smallresources
    • 🗺️qb-spawn
    • 🔫qb-storerobbery
    • 🏎️qb-streetraces
    • 🚕qb-taxijob
    • 🛻qb-towjob
    • 👁️qb-target
    • 🚛qb-truckerjob
    • 🔫qb-truckrobbery
    • 🔑qb-vehiclekeys
    • 📄qb-vehiclesales
    • 🚗qb-vehicleshop
    • 🍇qb-vineyard
    • 🔫qb-weapons
    • 🌤️qb-weathersync
    • 🌿qb-weed
Powered by GitBook

Community

  • Discord
  • Guilded
  • Reddit

Social Media

  • YouTube
  • Facebook
  • Twitch

@ 2025 QBCore Framework

On this page
  • Introduction
  • Features
  • ShowInput
  • CloseMenu

Was this helpful?

Edit on GitHub
  1. QBCore Resources

qb-input

Enter stuff here

Introduction

The QB Input system provides an interactive Lua-based user input form integrated with a web-based interface

Features

  • Multiple input types (text, password, number, radio, select, checkbox, color)

  • Customizable form submission

  • Dynamic styling through configuration

  • Easy-to-use Lua and JavaScript integration

ShowInput

Displays an input form and returns user input data.

  • data: table

    • header :string (optional)

    • submitText:string (optional)

    • inputs: table

      • type: string

      • name: string

      • text: string

      • default: any (optional)

      • isRequired: boolean (optional)

      • options: table (optional)

        • text: string

        • value: string

        • checked: boolean (optional)

RegisterCommand('testinput', function()
    local dialog = exports['qb-input']:ShowInput({
        header = "Test",
        submitText = "Bill",
        inputs = {
            {
                text = "Citizen ID (#)",
                name = "citizenid",
                type = "text",
                isRequired = true,
                default = "CID-1234",
            },
            {
                text = "Secret Code (Give to Nobody)",
                name = "code",
                type = "password",
                isRequired = true,
                default = "password123",
            },
            {
                text = "Bill Price ($)",
                name = "billprice",
                type = "number",
                isRequired = false,
                default = 1,
            },
            {
                text = "Bill Type",
                name = "billtype",
                type = "radio",
                options = {
                    { value = "bill", text = "Bill" },
                    { value = "cash", text = "Cash" },
                    { value = "bank", text = "Bank" }
                },
                default = "cash",
            },
            {
                text = "Include Tax?",
                name = "taxincl",
                type = "checkbox",
                options = {
                    { value = "gst", text = "10% incl."},
                    { value = "business", text = "35% incl.", checked = true },
                    { value = "othertax", text = "15% incl."}
                }
            },
            {
                text = "Some Select",
                name = "someselect",
                type = "select",
                options = {
                    { value = "none", text = "None" },
                    { value = "other", text = "Other"},
                    { value = "other2", text = "Other2" },
                    { value = "other3", text = "Other3" },
                    { value = "other4", text = "Other4" },
                    { value = "other5", text = "Other5" },
                    { value = "other6", text = "Other6" },
                },
                default = "other3",
            },
            {
                text = "Favorite Color",
                name = "favoritecolor",
                type = "color",
                default = "#ff0000",
            }
        }
    })

    if dialog ~= nil then
        for k,v in pairs(dialog) do
            print(k .. " : " .. v)
        end
    end
end, false)

CloseMenu

Closes the menu

exports['qb-input']:CloseMenu()
Previousqb-hudNextqb-interior

Last updated 8 days ago

Was this helpful?

📝