Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. validation

validation

Scheduled Pinned Locked Moved Java
helptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pancakeleh
    wrote on last edited by
    #1

    Needing help in validating textboxes to check if the textbox is null. I am netbeans and doing web application. Anyone knows where to find tutorial on this?

    L 1 Reply Last reply
    0
    • P pancakeleh

      Needing help in validating textboxes to check if the textbox is null. I am netbeans and doing web application. Anyone knows where to find tutorial on this?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Well, there is always the obvious place[^].

      Just say 'NO' to evaluated arguments for diadic functions! Ash

      P 1 Reply Last reply
      0
      • L Lost User

        Well, there is always the obvious place[^].

        Just say 'NO' to evaluated arguments for diadic functions! Ash

        P Offline
        P Offline
        pancakeleh
        wrote on last edited by
        #3

        i am now able to validation textboxes when the textboxes is null a error message will appear. Right now if the user enter the number 20 and he or she wants to add the number 20 again, an error will occour. how do i achieve tt? i tried google however have no clue on how to strt. Needing help..

        T L 2 Replies Last reply
        0
        • P pancakeleh

          i am now able to validation textboxes when the textboxes is null a error message will appear. Right now if the user enter the number 20 and he or she wants to add the number 20 again, an error will occour. how do i achieve tt? i tried google however have no clue on how to strt. Needing help..

          T Offline
          T Offline
          TorstenH
          wrote on last edited by
          #4

          Assuming you've split your code into MVC (Model, View and Controller) - and of course you did so ;-) You will store the data somewhere in a object. For this you're using a set-methode. This is a typical moment for checking integrity of the value:

          public void setIValue(final int iValue){
          if(null != iValue && 0 < iValue && 100 > iValue){
          this.iValue = iValue; //
          }
          else{
          // do funny action because value is not valid
          }
          }

          or you do delegate this validation to another class(when pushing some "OK"-button) or even your textbox itself (write an extension and trigger on lost of focus or keystroke(can become strange if validation takes to long)). regards, Torsten

          I never finish anyth...

          1 Reply Last reply
          0
          • P pancakeleh

            i am now able to validation textboxes when the textboxes is null a error message will appear. Right now if the user enter the number 20 and he or she wants to add the number 20 again, an error will occour. how do i achieve tt? i tried google however have no clue on how to strt. Needing help..

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            pancakeleh wrote:

            i tried google however have no clue on how to strt.

            I already gave you a link to the Java tutorials. I suggest you spend some more time going through them, especially the areas that you are having difficulty with.

            Just say 'NO' to evaluated arguments for diadic functions! Ash

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups