Alpha Video Training
Results 1 to 5 of 5

Thread: Address field Validation - A question

  1. #1
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    2,114

    Default Address field Validation - A question

    I have a char field called "address" in that field you might enter "123 happy lane" but for some reason a user will hit num lock and NOT enter the number part and just the street. Some secretaries use the number pad to enter the street address but somehow click numlock and since they are such great typists they don't have to look at the screen they can just keep typing and save..... THEN complain to say the record didnt save right so what I want to do is have an alert that says "The address field does not appear to contain a number and or start with a number, are you sure the address is correct?"
    my question is thus, is there some sort of custom validation that can be done to determine if the field "contains" a number at the field level, preferably in the onchange event - i don't want to stop a user from entering in bad data just let them know when it appears it might be bad data.

    I looked at some javascript code online elsewhere but not exactly sure how to implement it in AS I kinda want it to run in the validation rules. This is a grid but I would like to reuse this same code in a UX field as well
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

  2. #2
    Member
    Real Name
    Daniel Binns
    Join Date
    Apr 2017
    Posts
    45

    Default Re: Address field Validation - A question

    No idea if this is the best way but it should work

    var address = getyourfieldvalue
    var testvalue = parseInt(address)

    Then do whatever you want with that. eg if(isNAN(testvalue)) { alert("Address missing numbers"); }

    123 Happy Lane will not fire the alert, Happy Lane will. But Happy Lane 123 will not either.

    So as long as the numbers are always first i thing it works?

    You can throw into the onchange event or whatever.

  3. #3
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    2,114

    Default Re: Address field Validation - A question

    didn't know about parseINT in that way many thanks for the direction!
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

  4. #4
    Volunteer Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,772

    Default Re: Address field Validation - A question

    Charles,

    You could also show/hide a static text that says something like "Did you forget to indicate the integer part of the address?"

    This static text field would be shown if:

    val(left(address_field,1)=0) you would put this in the show/hide expression of the static text field.

    This should work also because if they forget to indicate the number part, it would be characters and the expression would be zero.
    Gary S. Traub, Ph.D.


  5. #5
    VAR
    Real Name
    Mike Reed
    Join Date
    Apr 2000
    Location
    Phoenix, AZ
    Posts
    660

    Default Re: Address field Validation - A question

    And don't forget to add a way to check for PO Boxes. Numbers will be at the end of the string.
    Mike Reed
    Phoenix, AZ

Similar Threads

  1. Address Field Validation
    By rbpd5015 in forum Alpha Five Version 8
    Replies: 9
    Last Post: 09-10-2019, 11:08 PM
  2. Immediate validation of an Email Address
    By Terrymorgan in forum Mobile & Browser Applications
    Replies: 14
    Last Post: 12-08-2018, 05:31 PM
  3. email address validation problem
    By tjmicro in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 12-06-2013, 09:29 AM
  4. Field validation question ....
    By Rich Hartnett in forum Application Server Version 10 - Web/Browser Applications
    Replies: 15
    Last Post: 11-14-2009, 01:24 PM
  5. Field Validation Rule Question??
    By Easy Rider in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 08-22-2008, 02:07 PM

Bookmarks

Posting Permissions

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