Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor suraj03's Avatar
    Join Date
    Jul 2011
    Posts
    54
    hi All,


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



    thanks,

    Suraj

  2. #2
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    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
    (Poster of the Month -Dec'12)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    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 C++
    Replies: 3
    Last Post: 2006-07-20, 05:25
  4. Catching what charecter was pressed
    By Blkangel in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved