locked
Column validation in sharepoint 2010 for Email RRS feed

  • Question

  • Hi,

    I need to apply general validation rule for Email in column validation. When i try to find some rule and apply it, its not working. please help.

    Thanks and Regards,

    Umang

    Friday, February 1, 2013 11:53 AM

Answers

All replies

  • Hi Umang,

    Have a try to add content editor web part on the form, then add some JQuery code to validation the email column, like

    <script type="text/javascript">
    $(document).ready(function(){ 
       /* our email input */
       var emailInput = $("input[title='Email']");
       /* the form we want to validate input */
       $("#aspnetForm").validate();
       /* The rule we add on the input */
       $(emailInput).rules("add", {
         email: true, 
         required: true, 
         messages: {
            email: "Please enter a valid email",
            required: "This field is required"
         } 
        });
    });

    For more information, see

    http://www.nothingbutbranding.com/blog/2012/august/sharepoint-form-validation-with-jquery

    Best Regards.


    Kelly Chen
    TechNet Community Support

    Monday, February 4, 2013 5:32 AM
  • Hi Kelly,

    Not working for me..
    Can you tell me something that i can put directly in the column validation formula?

    Thanks and Regards,
    Umang
    Tuesday, February 5, 2013 1:54 PM
  • Can you explain why it's not working?  What did you try and what happened?

    Email validation doesn't generally work well with column validation as it doesn't accept regular expressions.


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

    Tuesday, February 5, 2013 3:58 PM
    Answerer
  • Hi Steven,

    I follow the url http://www.nothingbutbranding.com/blog/2012/august/sharepoint-form-validation-with-jquery Put the first code in Newform.aspx under additional page head in head tag.

    Then add content query webpart on my list and put the second code in the url above. Now when i try to add item it doesnot validate. even if i left email blank it does not validate.

    Thanks

    Tuesday, February 5, 2013 4:19 PM
  • Have you tried moving the web-part with the code above the form web part?

    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

    Tuesday, February 5, 2013 5:29 PM
    Answerer
  • Yes i tried every thing but cant manage to sort this out...
    Thursday, February 7, 2013 3:21 PM
  • Hi,

    To use column validation features then have a look at the following articles, please check

    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/

    http://thechriskent.com/2012/08/16/validate-email-address-columns-in-sharepoint/

    Best Regards.


    Kelly Chen
    TechNet Community Support

    Friday, February 8, 2013 1:59 AM
  • I want to put my comment though this is a question long time ago, I think it might be helpful for the coming users.

    See, writing a rule to validate the user's input could be very hard.

    That's why we delivered a product for email address validation, and it can offer you other benefits.

    You can check it out here: www.leftwater.com.

    Wednesday, December 31, 2014 1:42 AM