Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Validate user input as a valid ssn.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Validate user input as a valid ssn.

    Ok here is my latest chalenge. I have a table in a set with a social security number field and the field rules for simple mask, 000-00-0000 is set. On my form when a user wants to enter a new claim they are prompted for a SSN from an action script (prompt for text), I have a default text of ###-##-#### but there is no gurantee of correct entry. If the entered value is not found in the table a new record is started and the SSN field on the form is pre-filled with the value entered at the preceeding prompt. I set the text property of the field to do this. If the SSN is entered at the prompt without dashes it is entered into field the same way and does not get modified by the table's field rules like I had hoped. It will modify the value if manually entered.

    1. Is there a way at the prompt to validate for a valid SSN entry?

    2. Is there a way to add the dashes like a mask?

    3. If the above two are not possible is there a way to use the field rules when the value is set to the field on the form?

    4. Is there another way to do this?

    #2
    Re: Validate user input as a valid ssn.

    When you say "valid SSN entry" do you mean that it is in the correct format (000-00-0000) or are you trying to match SSA's rules regarding numbers being in the correct range (from Wikipedia.com:
    Currently, a valid SSN cannot have an area number between 734 and 749, or above 772, the highest area number which the Social Security Administration has allocated.[15]. This should not be confused with Tax Identification Numbers which include additional area numbers[16].

    There are also special numbers which will never be allocated:

    Numbers with all zeros in any digit group (000-xx-####, ###-00-####, ###-xx-0000).[17]
    Numbers of the form 666-xx-####, probably due to the potential controversy (see Number of the Beast).[17]
    Numbers from 987-65-4320 to 987-65-4329 are reserved for use in advertisements.[18]
    The Administration publishes the last group number used for each area number.[19] Since group numbers are allocated in a regular (if unusual) pattern, it is possible to identify an unissued SSN that contains an invalid group number. Despite these measures, many fraudulent SSNs cannot easily be detected using only publicly available information.
    Anyway, my advice would be to:
    check length; number must be 9 digits
    strip out all characters using remspecial and rebuild it with something like:
    substr(remspecial(number_entered),1,3)+"-"+substr(remspecial(number_entered),4,2)+"-"+substr(remspecial(number_entered),6,4)

    I hope this helps.
    Jay
    Jay Talbott
    Lexington, KY

    Comment


      #3
      Re: Validate user input as a valid ssn.

      Greg, the data entry mask field rule only kicks in if the field value is entered from the keyboard. It sounds as though you are getting unformatted input from the user and then using a script to populate the field in your table. Data entry from the action script will not cause the mask field rule to kick in and format the string for you. As Jay suggests you're going to have to reformat the string yourself. This is challenging because of all the different ways the user can supply incorrect input.
      Last edited by Tom Cone Jr; 06-12-2009, 10:24 PM.

      Comment


        #4
        Re: Validate user input as a valid ssn.

        Thank you Jay and Tom for your help. My biggest concern was getting the SSN value entered correctly in the database in the correct format ###-##-####. I'm going to file Jay's notes on the SSA's rules for future use. So my solution was the following for anyone that may be interested.

        User is given a text prompt requesting a SSN entered without dashes. This value is stored in a variable and then tested by the following function I wrote.

        FUNCTION ValidateSSN AS C (SSNValue AS C )
        If isnumber(ssnvalue) = .t. .AND. len(SSNValue) = 9 then ' String consists of only numbers, "1234" and is the proper length.
        ValidateSSN = substr(SSNValue,1,3) + "-" + substr(SSNValue,4,2) + "-" + substr(SSNValue,6,4)
        Else
        ValidateSSN = "" ' Returning an empty string indicates invalid SSN.
        end if
        END FUNCTION


        This function verifys that the user did in fact enter a 9 digit number only. If this is the case the dashes are added and the result returned. If there is a problem a result of "" is returned indicating an error. If the user follows the directions correctly we now have a variable containing a properly formatted SSN value.

        Comment


          #5
          Re: Validate user input as a valid ssn.

          Even though the user is prompted to enter the SSN without dashes, you can make the process more user-friendly by allowing dashes and then stripping them out.
          Using the dashes makes checking the data entry easier for the user, and allowing, but not requiring the dashes will cover just about everybody.
          Use the remspecial() and allow dashes. I think you will be better off.
          Jay
          Jay Talbott
          Lexington, KY

          Comment


            #6
            Re: Validate user input as a valid ssn.

            You have a good point Jay, thanks, I will do that.

            Comment


              #7
              Re: Validate user input as a valid ssn.

              You can also use the mask() function. Also as Jay mentioned if you throw remspecial() into the mix you can allow users to add dashes or spaces.(sometimes it is convenient to enter the data as you see it on a hard copy so you can very it has been entered correctly) However, if you have users that actually 'follows the directions correctly' you are a fortunate devleoper. :)

              Code:
              [B]FUNCTION ValidateSSN AS C (SSNValue AS C )[/B]    
                   SSNValue [B]= [/B]remspecial(SSNValue)
                   If isnumber(ssnvalue) = .t. .AND. len(SSNValue) = 9 then [COLOR=Blue]' String consists of only numbers, "1234" and is the proper length.     [/COLOR]
                   ValidateSSN = mask(SSNValue,"   -  -    ")
                   Else
                  ValidateSSN = "" [COLOR=Blue]' Returning an empty string indicates invalid SSN. [/COLOR]    
                   end if    
              [B]END FUNCTION[/B]
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Validate user input as a valid ssn.

                The mask() does make for cleaner code. Yeah I'm always amazed at how users can do things that I would never expect. :)

                Comment

                Working...
                X