Page 1 of 1

Preventing certain characters from being input

Posted: Fri Jun 17, 2011 11:43 am
by Darren
Can any body tell me how I can Preventcertain characters from being input into an edit box. For example, I do not want the ?, ?, $, % or & characters to be placed into an edit box. How can I do this???

Many thanks in advance!!!

Darren

Preventing certain characters from being input

Posted: Sat Jun 18, 2011 3:47 pm
by Marco
this will help I guess:


`prevent characters whithin an edit
object myform as form
  object myedit as edit
    onkeypress=myedit_keypress
  end object
  showmodal
end object

sub myedit_keypress(key as byte)
   if instr("!@#$%^&*()",chr$(key))>0 then key=0
end sub