weisianz
asked on
disable enter key
mm.. how do i disable the enter function in editable textfield?
i tried using the below script but, the enter key is not disabled
on keydownscript me
if the keycode = 36 then
nothing
end if
end
i tried using the below script but, the enter key is not disabled
on keydownscript me
if the keycode = 36 then
nothing
end if
end
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
It may if its placed in the script. You were using on keydownscript which will not register when you type in teh field. Also note that many keyboards have 2 entere keys with different key codes. :)
ASKER
i placed another script in the field
on keydown me
if keycode = 36 then
halt
end
when i press enter, the movie is indeed stop.
but, when i change it to
on keydown me
if keycode = 36 then
nothing
end if
end
it's like, all keys disabled... nothing appears in the txtfield... is it cause by the nothing statement?
on keydown me
if keycode = 36 then
halt
end
when i press enter, the movie is indeed stop.
but, when i change it to
on keydown me
if keycode = 36 then
nothing
end if
end
it's like, all keys disabled... nothing appears in the txtfield... is it cause by the nothing statement?
You need the else. It needs to be told to pass to allow other keys through.
ASKER
oh... so, i just have to change it to the following?
on keydown me
if keycode = 36 then
nothing
else
pass
end if
end
on keydown me
if keycode = 36 then
nothing
else
pass
end if
end
Correct. :)
ALso add it for keyUp as well to be safe. SOme keyboards register the events a bit differently.
ALso add it for keyUp as well to be safe. SOme keyboards register the events a bit differently.
ASKER
oic... ok... thanks
ASKER