[HELP] DTextEntry affect DLabel?

How can I have a DTextEntry affect a DLabel
so like a first name and a last name?

Also have it update everytime someones types a letter instead of when they press enter.
I believe that is this though.
[LUA]DTextEntry:SetUpdateOnType( true )[/LUA]



function someTextEntry:OnValueChange( strValue )
    someLabel:SetText( strValue )
end


I have noticed that the text entry “on enter” and “set update on type” override each other.
so if you want name to update and for some sgit to happen on enter do this:


function texentryvar:OnKeyCodeTyped(key)
               theLabel:SetText( self:GetValue() )

		if key == KEY_ENTER then
			// do some other sgit here if you want
		end
end

also dont do DTextEntry:SetUpdateOnType( true )

attempt to index global ‘LastName’ (a nil value)
[LUA]function FirstName:OnKeyCodeTyped(key)
LastName:SetText( self:GetValue() )

	if key == KEY_ENTER then
		print("lol")
	end

end[/LUA]

[editline]22nd November 2016[/editline]

nvm it was because I had the function before the dlabel