character validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kaleeswaran
    New Member
    • Mar 2007
    • 132

    #1

    character validation

    now i am creating login page...
    so in my name field i should get a charcter value only other wise it should be shows the error ...
    how to do the validation ?....
    send me the code plzzzzzzzzz
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Read the API docs for the JTextField class which shows a nice example
    of conditionally accepting characters. If you're feeling real adventurous have a
    look at the JFormattedTextF ield class for more sophisticated filtering.

    kind regards,

    Jos

    Comment

    • kaleeswaran
      New Member
      • Mar 2007
      • 132

      #3
      thank you ,
      but now i am using java scripts so tell me the solution in java scripts....

      Comment

      • kaleeswaran
        New Member
        • Mar 2007
        • 132

        #4
        java scripts

        now i am creating login page...
        so in my name field i should get a charcter value only other wise it should be shows the error ...
        how to do the validation ?....
        send me the code plzzzzzzzzz

        --------------------------------------------------------------------------------

        and another one is :
        i am going to get a string like this "hai;javascript "
        but the string should be divided into two string in the sense before the ; takes as one string and after the ; takes as another string ..
        so clear me my this two doupts as soon as possible

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by kaleeswaran
          thank you ,
          but now i am using java scripts so tell me the solution in java scripts....
          You should ask that question in a Javascript forum. Java is not Javascript,
          no matter the identical prefix in their name.

          kind regards,

          Jos

          Comment

          • hirak1984
            Contributor
            • Jan 2007
            • 316

            #6
            Sorry we dont send codes...
            Originally posted by kaleeswaran
            send me the code plzzzzzzzzz

            Comment

            • kaleeswaran
              New Member
              • Mar 2007
              • 132

              #7
              Fine,
              but i already asked in javascript forum but they did't replay me..that's y i asked here...
              anyway i try to solve my problem my self...
              thank you,

              Comment

              • kaleeswaran
                New Member
                • Mar 2007
                • 132

                #8
                That's okay,
                atleast give me a glue plzzzzz..

                Comment

                • r035198x
                  MVP
                  • Sep 2006
                  • 13225

                  #9
                  Moved to Javascript forum.

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    Merged threads.

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Originally posted by kaleeswaran
                      now i am creating login page...
                      so in my name field i should get a charcter value only other wise it should be shows the error ...
                      how to do the validation ?....
                      send me the code plzzzzzzzzz
                      What code do you have so far?

                      See the form validation links in the Offsite Links thread (at the top of this forum).

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        Originally posted by kaleeswaran
                        and another one is :
                        i am going to get a string like this "hai;javascript "
                        but the string should be divided into two string in the sense before the ; takes as one string and after the ; takes as another string ..
                        so clear me my this two doupts as soon as possible
                        Use the split function to split the string into an array with the two strings separated:
                        Code:
                        var arr = str.split(";")
                        Then arr[0] would be the first string.

                        Comment

                        Working...