{"id":60735,"date":"2016-01-21T04:22:50","date_gmt":"2016-01-21T09:22:50","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=60735"},"modified":"2016-03-15T08:33:20","modified_gmt":"2016-03-15T12:33:20","slug":"js-animated-how-to-deal-with-validation-of-special-characters-in-contact-form-rd-mailform","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/js-animated-how-to-deal-with-validation-of-special-characters-in-contact-form-rd-mailform.html","title":{"rendered":"JS Animated. How to deal with validation of special characters in contact form rd-mailform"},"content":{"rendered":"<p>This tutorial is going to show you how to add <strong>special characters<\/strong> to the validation patterns for the contact form <strong>rd-mailform<\/strong> in JS Animated templates.<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=NsG2hY0TQ98?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to deal with validation of special characters in contact form rd-mailform<\/a>\r\n\r\n\t<p>In order to add <strong>special characters<\/strong> to the validation patterns, you need to do the following steps:<\/p>\r\n\r\n\t<ol>\r\n\t\t<li>\r\n\t\t\t<p>Open up the <strong>js\/mailform\/jquery.rd-mailform.min.js<\/strong> file using your favorite code editor.<\/p>\r\n\t\t<\/li>\r\n\t\t<li>\r\n\t\t\t<p>Locate the <strong>constraints<\/strong> array on line 71. There are 7 validation strategies: <em>LettersOnly, NumbersOnly, NotEmpty, Email, Phone, Date, SelectRequired<\/em>. Validation patterns are defined by the <strong>rule<\/strong> variable:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1-300x169.jpg\" alt=\"JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-60736\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-1.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n\t\t<li>\r\n\t\t\t<p>If you need to add <strong>special characters<\/strong> to the LettersOnly stategy, you need to insert them inside the square brackets of the rule pattern. For example, let&#8217;s add the character <strong>\u4eba<\/strong>. Here is the original validation rule:<\/p>\r\n<pre class=\"brush:js\">\r\nrule: \"^([a-zA-Z\u0430-\u044f\u0410-\u042f\u0456\u0457\u0451\u0406\u0407\u0401\u0454\u0404\u0490\u0491\\\\s]{0,})$\",\r\n<\/pre>\r\n\t\t\t<p>This is the rule after inserting the character <strong>\u4eba<\/strong>:<\/p>\r\n<pre class=\"brush:js\">\r\nrule: \"^([\u4ebaa-zA-Z\u0430-\u044f\u0410-\u042f\u0456\u0457\u0451\u0406\u0407\u0401\u0454\u0404\u0490\u0491\\\\s]{0,})$\",\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2-300x169.jpg\" alt=\"JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-60737\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-2.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n\t\t<li>\r\n\t\t\t<p>Save the changes to the <strong>jquery.rd-mailform.min.js<\/strong> file. Make sure you save the file with the <strong>UTF-8<\/strong> encoding.<\/p>\r\n\t\t<\/li>\r\n\t\t<li>\r\n\t\t\t<p>Now if you include the <strong>\u4eba<\/strong> to the &#8220;Your Name&#8221; field, the script will consider it valid:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3-300x169.jpg\" alt=\"JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-60738\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/01\/JS_Animated._How_to_deal_with_validation_of_special_characters_in_contact_form_rd-mailform-3.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n\t\t<li>This way you can insert any character or a sequence of characters. You can also look up in the Internet to find a specific validation pattern for your language, which will include all characters. When submitting a search query you need to write it as &#8220;validation pattern for Arabic characters&#8221;. You can also visit <a href=\"http:\/\/kourge.net\/projects\/regexp-unicode-block\" rel=\"nofollow\" target=\"_blank\">this<\/a> website. It will help you create a unicode regex for many languages.<\/li>\r\n\t<\/ol>\r\n\r\n\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=NsG2hY0TQ98?width=1280&amp;height=720\" rel=\"prettyPhoto\">JS Animated. How to deal with validation of special characters in contact form rd-mailform<\/a>","protected":false},"excerpt":{"rendered":"<p>This tutorial is going to show you how to add <strong>special characters<\/strong> to the validation patterns for the contact form <strong>rd-mailform<\/strong> in JS Animated templates.<\/p>\n","protected":false},"author":85,"featured_media":60740,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1016],"tags":[2411,2073,2164,1025],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/60735"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=60735"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/60735\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/60740"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=60735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=60735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=60735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}