Jump to content

Help please. only letters and numbers in editbox


titan_boy

Recommended Posts

hello all,

can someone help me please with a problem? The problem is that i will make a edit box for only letters and numbers. not !~!@#$%^&* ect.

i know this:

theEdit = guiCreateEdit( 15, 326, 221, 33, "", false, Window["mainWindow"] )

local txt = guiGetText(theEdit)

local text = string.gsub(txt, "[^a-z]", "")

local text = string.gsub(txt, "[^0-9]", "")

but idk what i need to do with this.

help me please.

Link to comment

thank you Solidsnake14 but how do i put this in my script? like this?:

function acceptedNames(element) 
local myString = "Hello World ^^,-*/-/*/-,." 
myString:gsub ( "%p", "" ) 
end 
addEventHandler("onClientGUIChanged", theEdit, acceptedNames, false) 

can someone give my an example of the function?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...