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

Immediate validation of an Email Address

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

    Immediate validation of an Email Address

    I am using Validation Xbasic
    if a5_is_email_valid(e.data.EMAILADDRESS) = .f. then
    validate_EMAILADDRESS.hasError = .t.
    validate_EMAILADDRESS.errorText = "This is not a valid Email Address."
    end if
    which works fine, but I would prefer something that Immediately validates rather than at submit.
    Is there another place to put this code or a javascript version.
    Thanks

    #2
    Re: Immediate validation of an Email Address

    You will have to do the validation on the client side. There are a lot of samples of code that checks email validity in JavaScript on the internet.
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    Comment


      #3
      Re: Immediate validation of an Email Address

      I use the Validation Rules for the field to do this:
      Data Value -> Validation Expression Type: Custom Expression -> Custom Expression: a5_email_valid(CurrentValue)
      Carol King
      Developer of Custom Homebuilders' Solutions (CHS)
      http://www.CHSBuilderSoftware.com

      Comment


        #4
        Re: Immediate validation of an Email Address

        Thanks Carol - just what I was looking for!
        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?"

        Comment


          #5
          Re: Immediate validation of an Email Address

          Wow! I think AA has it all, think from this point on, am simply going to click click on any button, eclipse I see and find out where it leads, how would I have come to this if not from spending some time here in the forum?!
          Regards,

          Kotin Karwak
          Developer Edition
          Version 12.3 Build 2684
          System Addins: Build 4438
          Build machine Windows Vista
          Skype: mateso08

          Comment


            #6
            Re: Immediate validation of an Email Address

            Kotin,
            you will find that the more you dig in the more you learn, the more you can do and then going forward in application development you can add new features faster than most developers can even think about it! I overheard a customer of an industry application provider saying to one of the owners that his biggest concern was that when they requested a new feature it would take months and sometimes more than a year to get incorporated! My users ask for something and I can usually deliver code changes in a day!
            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?"

            Comment


              #7
              Re: Immediate validation of an Email Address

              Originally posted by kingcarol View Post
              I use the Validation Rules for the field to do this:
              Data Value -> Validation Expression Type: Custom Expression -> Custom Expression: a5_email_valid(CurrentValue)
              I am trying to use this, on data entry and modification, to allow EITHER a valid email address in the field OR for the field to be left blank. I can achieve the first but cannot figure out how to allow the field to be empty. Any help much appreciated

              Comment


                #8
                Re: Immediate validation of an Email Address

                If you wanted to validate client side I've always liked this one... mainly because it's one of the coolest expressions I've ever seen. This returns true or false.

                Code:
                function validateEmail(email) {
                    var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
                    return re.test(email);
                }
                Also, I think a5_email_valid() has been deprecated. Use A5_IS_EMAIL_VALID() instead.

                Comment


                  #9
                  Re: Immediate validation of an Email Address

                  Originally posted by Davidk View Post
                  Also, I think a5_email_valid() has been deprecated. Use A5_IS_EMAIL_VALID() instead.
                  Many thanks for that, I like your expression (although too complicated for me!) However I have now got a result using the following custom validation, where EMAIL is the name of the field containing the email address, so it will now only accept a correctly formatted email address or be left blank

                  A5_IS_EMAIL_VALID(EMAIL).OR.EMAIL=" "

                  Comment


                    #10
                    Re: Immediate validation of an Email Address

                    Currently, it looks like the easiest thing to do, especially for a beginner at this is (in a UX) go to the field properties, open the validation javascript and comment out the already written code supplied by Alpha Software! I don't think that was available back when I first asked (over 3 years ago!) but it is in there now! Of course, it could have taken me 3 year to see it, lol.

                    The code isn't immediate as in an onchange event, but it stops the list control from submitting and alerts the user of the error. One thing of note, ".co" is considered valid just like ".com" so if your user fudges it, he probably won't be aware of it.
                    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?"

                    Comment


                      #11
                      Re: Immediate validation of an Email Address

                      ".co" is considered valid because it is valid. There is life outside...

                      Comment


                        #12
                        Re: Immediate validation of an Email Address

                        yep, that's what I was saying essentially. Also for the new guy wanting to snag some simple code to get it working a bit better...this allows a blank field as well as validate the entry for an email address.

                        Code:
                        var emailfield = data;
                        if(emailfield = ' '){
                        	return true; 
                        	} else {
                        var flag = A5.emailValid(data);
                        if(flag) {return true;} else {return 'Not valid email';}
                        }
                        ***See POST #13 for corrected code
                        Last edited by CharlesParker; 12-08-2018, 06:16 PM.
                        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?"

                        Comment


                          #13
                          Re: Immediate validation of an Email Address

                          Originally posted by CharlesParker View Post
                          yep, that's what I was saying essentially. Also for the new guy wanting to snag some simple code to get it working a bit better...this allows a blank field as well as validate the entry for an email address.

                          Code:
                          var emailfield = data;
                          if(emailfield = ' '){
                          	return true; 
                          	} else {
                          var flag = A5.emailValid(data);
                          if(flag) {return true;} else {return 'Not valid email';}
                          }
                          Your code and concept need a bit of correction. You're actually assigning the value of a "space" to emailfield... not testing emailfield for a value.
                          You also shouldn't use a "space" as a value to compare. You should use an empty string.
                          As you've noted, A5.emailValid isn't available until the Nov 7 2018 release.
                          Although not required, camelCase is fairly well accepted Javascript notation.
                          Since you already have "data", there's not really any need to assign a new variable to it's value.
                          Your code should be...

                          Code:
                          if(data == ''){
                          	return true; 
                          }else{
                          	var flag = A5.emailValid(data);
                          	if(flag){
                          		return true;
                          	}else{
                          		return 'Not valid email';
                          	}
                          }

                          Comment


                            #14
                            Re: Immediate validation of an Email Address

                            Thanks David! I'm going to follow your advice, I wish I had a better understanding of "concept" but I am only as good as my teacher. Being self taught, I am proud to have gotten as far as I have, but honestly it's been great advice from guys like you who care enough to post code and a little concept.

                            I am having trouble trying to figure out when I might use "this.data" vs "data" vs "this" as well so any advice you could give on that (is it in the documentation?)would be mighty welcome, probably would be better-off discussed in another thread though.
                            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?"

                            Comment


                              #15
                              Re: Immediate validation of an Email Address

                              Most of the time you don't get to choose. You must use what Alpha gives you. In this case "data" carries the value in the control... whereas there is no "this.data". The inline doc usually tells you want you need to use and, in this case, so does the example code.

                              Comment

                              Working...
                              X