×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    restricting the use of special charecter

    hi All,


    How to restrict the use of special character (like @,#,$%,*,&)in the textfields.



    thanks,

    Suraj

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: restricting the use of special charecter

    Quote Originally Posted by suraj03 View Post
    hi All,


    How to restrict the use of special character (like @,#,$%,*,&)in the textfields.



    thanks,

    Suraj
    You can add a ItemStateListener() to your textfield, so when user enters any character - notifyStateChanged() method will be called in this method you can check if any unwanted special character is added to the end of the string (using String operations) you can remove it and set rest of the string back to the textfield.
    All this will happen so fast that enduser will feel that he is not allowed to enter these characters or if you want you can event display an alert for the same.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: restricting the use of special charecter

    Or Even you can display an alert to the user that the the special chars are not allowed.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. restricting access
    By ashwin.nath.m in forum Mobile Java General
    Replies: 2
    Last Post: 2009-10-15, 08:28
  2. Restricting Anauthorized Access
    By sprateek in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2009-04-11, 16:02
  3. restricting user access
    By ceehira in forum Symbian
    Replies: 3
    Last Post: 2006-07-20, 05:25
  4. Catching what charecter was pressed
    By Blkangel in forum Symbian
    Replies: 1
    Last Post: 2004-01-22, 12:00
  5. Restricting Access to a WML Page
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-16, 14:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×