Showing posts with label Validation. Show all posts
Showing posts with label Validation. Show all posts

Monday, 22 February 2016

Phone number validation using libPhoneNumber Library


55.png

libPhoneNumber

libphoneNumber Library is used to validate the phone number and it is a google's library mostly used by google products and Whatsapp
phone number validation is important for app so that you can get valid number from your users. Any verification code, messages that you want to send them will have less chances of being missed.
Read full Blog about Phone number validation using libPhoneNumber Library at Findnerd.

About Findnerd
FindNerd was started as a Q&A Portal and Knowledge Base for people of Evon Technologies. Gradually, we, at the company, made it more interactive and evolved it as a Collaboration Tool. It began to get exciting and next; we branched out and evolved it as a Project Management tool and Employee Productivity Management tool too. Soon, we realized that now when we have savoured the taste of the multi-functional platform, why not to present it to the world to use!
Read more about Findnerd here>> Findnerd-A Social Network for Developers

Tuesday, 9 June 2015

How to check if the email is valid in iOS sdk

Many apps require email validation in iOS. Here the function that can be used to check if email string is valid or not. It can be achieved by NSPredicate like following:
  1. -(BOOL)isValidEmail:(NSString *)checkString
  2. {
  3. long numberOfAtPieces = [[checkString componentsSeparatedByString:@"@"] count];
  4. if (numberOfAtPieces > 2){
  5. return NO;
  6. }
  7. BOOL stricterFilter = NO;
  8. NSString *stricterFilterString = @"[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}";
  9. NSString *laxString = @".+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2}[A-Za-z]*";
  10. NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
  11. NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
  12. return [emailTest evaluateWithObject:checkString];
  13. }
Just past the checkString as email you want to validate and it returns 'YES' if email is valid else returns 'NO'.


For such more Blogs you can visit to http://findnerd.com/NerdDigest

Tuesday, 20 January 2015

Form Validations in HTML5


Different type of validation for HTML5:

    1. Required Attribute: It is used when the value before submission of a form in not filled.
    It is sometimes known as Mandatory or Compulsory field.

    Use of "required" attribute.
    Example:

        <form action="" method="post">
        Name:<br>
        <input type="text" name="name" required>
        <br>
        Age:<br>
        <input type="text" name="age" required><br>
        Email:<br><input type="email" name="email" required placeholder="Enter a valid email address"><br>
        Website:<br><input type="url" name="website" required pattern="https?://.+"><br>
        <input type="submit" />
        </form><br>

To read complete information about Form Validations in HTML5 please visit FindNerd. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including android, php, java, c programming questions and answers etc.