
{"id":2115,"date":"2023-08-21T11:46:18","date_gmt":"2023-08-21T15:46:18","guid":{"rendered":"https:\/\/wpcrm1.givelife365.com\/?page_id=2115"},"modified":"2025-10-27T08:12:21","modified_gmt":"2025-10-27T12:12:21","slug":"register","status":"publish","type":"page","link":"https:\/\/demo.givelife365.com\/fr\/register\/","title":{"rendered":"Register"},"content":{"rendered":"\n<div class=\"wp-block-icds-gutenberg-monaco-block\"><section class=\"content-section\">\n        <div class=\"container\" id=\"mainBodyContainer\" >\n            <div class=\"row\">\n                <div class=\"col-lg-8 offset-lg-2  col-md-10 offset-md-1\">\n                    <div class=\"card-register\">\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-md-5 col-sm-5 col-12\">\n                                <div class=\"signupbg\">\n                                    <img decoding=\"async\" src=\"\/wp-content\/uploads\/2023\/08\/intsign.png\">\n                                <\/div>\n                            <\/div>\n                            <div class=\"col-lg-6 col-md-7 col-sm-7 col-xs-12\">\n\n                                <form autocomplete=\"off\" name=\"mainContactForm\" novalidate=\"\"  >\n                                    <div class=\"card-registerinner row\">\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <h3>S&rsquo;inscrire <\/h3>\n                                        <\/div>\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <div class=\"form-group\">\n                                                <label for=\"title\" class=\"form-label\">Titre<span class=\"text-danger\">*<\/span><\/label>\n                                                <select name=\"title\"  id=\"title\" class=\"form-select form-control\"  required=\"required\">\n                                                    <option value=\"\" disabled=\"\" selected=\"selected\">S\u00e9lectionnez le titre<\/option>\n                                                    <option value=\"772350002\">Mr<\/option>\n                                                    <option value=\"772350003\">Mrs<\/option>\n                                                    <option value=\"772350007\">Miss<\/option>\n                                                    <option value=\"772350008\">Master<\/option>\n                                                    <option value=\"772350000\">Dr<\/option>\n                                                    <option value=\"772350004\">Ms<\/option>\n                                                    <option value=\"772350001\">Prof<\/option>\n                                                    <option value=\"772350009\">Mx<\/option>\n                                                    <option value=\"772350010\">Reverend<\/option>\n                                                <\/select>\n                                                <div class=\"error-message hidden\" id=\"titleError\">Veuillez s\u00e9lectionner le titre<\/div>\n                                            <\/div>\n                                        <\/div>\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <div class=\"form-group\">\n                                                <label for=\"firstname\" class=\"required\">Pr\u00e9nom <\/label>\n                                                <input type=\"text\" class=\"form-control alphabets-only\" id=\"FirstName\" name=\"firstname\" placeholder=\"Pr\u00e9nom\" required=\"required\">\n                                                <div class=\"error-message hidden\" id=\"firstnameError\">Le pr\u00e9nom est obligatoire et doit \u00eatre valide.<\/div>\n                                            <\/div>\n                                        <\/div>\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <div class=\"form-group\">\n                                                <label for=\"lastname\" class=\"required\">Nom de famille <\/label>\n                                                <input type=\"text\" class=\"form-control alphabets-only\" id=\"LastName\" name=\"lastname\" placeholder=\"Nom de famille\" required=\"required\">\n                                                <div class=\"error-message hidden\" id=\"lastnameError\">Le nom de famille est obligatoire et doit \u00eatre valide.<\/div>\n                                            <\/div>\n                                        <\/div>\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <div class=\"form-group\">\n                                                <label for=\"emailaddress\" class=\"required\">Adresse email <\/label>\n                                                <input type=\"email\" class=\"form-control\" id=\"email\" name=\"emailaddress1\"  placeholder=\"E-mail\" required=\"required\">\n                                                <div  class=\"error-message hidden\" id=\"emailError\">L&rsquo;e-mail est obligatoire et doit \u00eatre valide.<\/div>\n                                            <\/div>\n                                        <\/div>\n\n                                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\n                                            <div class=\"form-group\">\n                                                <label for=\"phoneno\" class=\"required\">Num\u00e9ro de t\u00e9l\u00e9phone<\/label>\n                                                <input type=\"number\" name=\"mobilephone\" class=\"form-control\" id=\"phoneno\" placeholder=\"Entrez le num\u00e9ro de t\u00e9l\u00e9phone\" required=\"required\">\n                                                <div class=\"error-message hidden\" id=\"phonenoError\">Le num\u00e9ro de t\u00e9l\u00e9phone est obligatoire et doit \u00eatre valide.<\/div>\n                                            <\/div>\n                                        <\/div>\n\n                                        <div class=\"clearfix\"><\/div>\n                                        <div class=\"col-lg-12 \">\n                                            <button type=\"submit\" class=\"btnSubmit\" id=\"btnRegistarSubmit\"> S&rsquo;inscrire <\/button>\n                                        <\/div>\n                                        <div class=\"col-lg-12 account\">\n                                            <p>Vous avez d\u00e9j\u00e0 un compte ?<a href=\"\/b2c-login\"> Se connecter <\/a><\/p>\n                                        <\/div>\n                                    <\/div>\n                                <\/form>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/section>\n    \n         \n    <script>\n        jQuery(function($) {\n            \n    $(document).ready(function() {\n        \n        \n        $('#title').on('change', function() {\n            if ($('#title').val() === '' || $('#title').val() == null) {\n              $('#titleError').removeClass('hidden');\n            } else {\n              $('#titleError').addClass('hidden');\n            }\n          });\n          $('#email').on('focusout', function() {\n            const emailInput = $('#email').val().trim();\n            \n            if (emailInput === '') {\n                $('#emailError').text('Email address is required.').removeClass('hidden');\n            } else if (!isValidEmail(emailInput)) {\n                $('#emailError').text('Invalid email address.').removeClass('hidden');\n            } else {\n                $('#emailError').addClass('hidden');\n            }\n        });\n        \n          \/\/ First Name validation\n          $('#FirstName').on('focusout', function() {\n            if ($('#FirstName').val().trim() === '') {\n              $('#firstnameError').removeClass('hidden');\n            } else {\n              $('#firstnameError').addClass('hidden');\n            }\n          });\n        \n          \/\/ Last Name validation\n          $('#LastName').on('focusout', function() {\n            if ($('#LastName').val().trim() === '') {\n              $('#lastnameError').removeClass('hidden');\n            } else {\n              $('#lastnameError').addClass('hidden');\n            }\n          });\n          \n          $('.alphabets-only').keypress(function (e) {\n                var regex = new RegExp(\"^[a-zA-Z ]+$\");\n                var strigChar = String.fromCharCode(!e.charCode ? e.which : e.charCode);\n                if (regex.test(strigChar)) {\n                    return true;\n                }\n                return false;\n          });\n        \n          \/\/ Phone Number validation\n        \/\/   $('#phoneno').on('focusout', function() {\n        \/\/       phoneNumber = $('#phoneno').val().trim();\n        \/\/       if (phoneNumber === '') {\n        \/\/         $('#phonenoError').text('Mobile Number is required');\n        \/\/         isValid = 0;\n        \/\/     }else{\n        \/\/         if (!\/^[0-9]{10}$\/.test(phoneNumber)) {\n        \/\/           $('#phonenoError').text('Please enter a valid 10-digit phone number.');\n        \/\/           isValid = 0;\n        \/\/         }else{\n        \/\/             $('#phonenoError').addClass('hidden');\n        \/\/         }\n        \/\/     }\n           \n        \/\/   });\n        \n        $('#phoneno').on('focusout',function(){\n            $('#phonenoError').addClass('hidden');\n            if ($('#phoneno').val().trim() === '') {\n                $('#phonenoError').removeClass('hidden');\n                $('#phonenoError').text('Mobile Number is required');\n                isValid = 0;\n            }else{\n                checkTenDigitNumber();\n            }\n        });\n        \n        \/\/ $('#phoneno').on('keydown', function (e) {\n        \/\/     var $this = $(this);\n        \/\/     var regex = new RegExp(\"^[0-9\\b]+$\");\n        \/\/     var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);\n            \n        \/\/     \/\/ for 10 digit number only\n        \/\/     if ($this.val().length > 9 && e.which != 8) {\n        \/\/         e.preventDefault();\n        \/\/         return false;\n        \/\/     }\n        \/\/     if (e.which == 17 || e.which == 91 || e.which == 86 || e.which == 67 || e.which == 86 || e.which == 65 || e.which == 88) {\n        \/\/         return true;\n        \/\/     }\n        \/\/     if ((e.which < 48 || e.which > 57)) {\n        \/\/         if ($this.val().length == 0) {\n        \/\/             e.preventDefault();\n        \/\/             return false;\n        \/\/         } else {\n        \/\/             return true;\n        \/\/         }\n        \/\/     }\n        \/\/     if (regex.test(str)) {\n        \/\/         return true;\n        \/\/     }\n        \/\/     e.preventDefault();\n        \/\/     return false;\n        \/\/ });\n        \n        const phoneno = document.getElementById(\"phoneno\");\n        const phonenoerror = document.getElementById(\"phonenoError\");\n        phoneno.addEventListener('input', function(e) {\n        \tconst mobileNumber = this.value.trim();\n        \tif (this.value.trim().length > 10) {\n        \t    this.value = this.value.slice(0, -1);\n                return false;\n            }\n        });\n        \n          \n          \n         \n        });\n\n    function checkTenDigitNumber() {\n        if (!\/^[0-9]{10}$\/.test($('#phoneno').val().trim())) {\n            $('#phonenoError').removeClass('hidden');\n            $('#phonenoError').text('Please enter a valid 10-digit phone number.');\n            return false;\n        }\n        return true;\n    }\n    \n    document.getElementById('phoneno').addEventListener('keydown', function(e) {\n        if (e.which === 38 || e.which === 40) {\n            e.preventDefault();\n        }\n    });\n    \n    function isValidEmail(email) {\n        \/\/ Regular expression for basic email validation\n        const emailRegex = \/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$\/;\n        return emailRegex.test(email);\n    }\n    function validateForm() {\n        let isValid = true;\n\n        \/\/ Clear previous error messages\n        $('.error-message').addClass('hidden');\n        var title = $('#title').val();\n        \n        if (title === null || title === '') {\n            $('#titleError').removeClass('hidden');\n            isValid = false;\n            console.log(\"titleError\");\n        }\n\n        \/\/ Validate First Name\n        if ($('#FirstName').val().trim() === '') {\n            $('#firstnameError').removeClass('hidden');\n            isValid = false;\n            console.log(\"FirstName\");\n        }\n\n        \/\/ Validate Last Name\n        if ($('#LastName').val().trim() === '') {\n            $('#lastnameError').removeClass('hidden');\n            isValid = false;\n            console.log(\"LastName\");\n        }\n\n        \/\/ Validate Email Address\n        if ($('#email').val().trim() === '') {\n            $('#emailError').removeClass('hidden');\n            isValid = false;\n            console.log(\"emailError if\");\n        } else {\n            if (!isValidEmail($('#email').val().trim())) {\n                $('#emailError').removeClass('hidden');\n                isValid = false;\n                console.log(\"emailError\");\n            } else {\n                \n            }\n            \n        }\n\n            console.log(\"no problem\");\n        \/\/ var regexPhone = \/^(0|91)?[6-9][0-9]{9}$\/;\n        \/\/ var regexPhone = \/^[0-9]{10}$\/;\n        var regexPhone = \/^(?!(\\d)\\1{9})(?!0123456789|1234567890|0987654321|9876543210)\\d{10}$\/;\n        \/\/ Validate Phone Number\n        if ($('#phoneno').val().trim() === '') {\n            console.log(\"phonenoError\");\n            $('#phonenoError').text('Mobile Number is required');\n            $('#phonenoError').removeClass('hidden');\n            isValid = false;\n        } else if(!regexPhone.test($(\"#phoneno\").val())) {\n            console.log(\"phonenoError else if\");\n            $('#phonenoError').text('Please enter valid phone number');\n            $('#phonenoError').removeClass('hidden');\n            isValid = false;\n        } else {\n            if(!checkTenDigitNumber()) { \n            console.log(\"else\");\n            isValid = false; }\n        }\n        return isValid;\n    }\n   \n\n            $('form[name=\"mainContactForm\"]').on('submit', function(event) {\n                event.preventDefault();   \n                if (!validateForm()) {\n                    \n                }else{\n                    jQuery(document).ready(function($) {\n                         $(\"#loader\").removeClass(\"hidden\");\n                            var data = {\n                                action: 'email_validation_action',\n                                email : $('#email').val().trim()\n                            };\n                                $.post(volunteerStartup.ajaxUrl, data, function(response) {\n                                    if (response.trim() === '0') {\n                                        $('#emailError').removeClass('hidden');\n                                        $('#emailError').html('Email Address already exists.');\n                                        $('#email').focus();\n                                         $(\"#loader\").addClass(\"hidden\");\n                                        return false;\n                                    } else {\n                                        callFinalAjax();\n                                    }\n                                });\n                        \n                    });\n\n                    \n                }\n            });\n            function callFinalAjax(){\n                        var dataToUpdate = {\n                            \"Name\": \"createVolunteer\",\n                            \"Firstname\": $(\"#FirstName\").val(),\n                            \"Lastname\": $(\"#LastName\").val(),\n                            \"av_title\": $(\"#title\").val(),\n                            \"mobilephone\": $(\"#phoneno\").val(),\n                            \"Emailaddress1\": $(\"#email\").val(),\n                            \"plan_id\": \"\" \n                        };\n               var registerUrl = '';\n               var str_plan_id = '';\n               str_plan_id = \"\";\n\n\n                $.ajax({\n                        url: \"https:\/\/glwpintegrationsdemo.azurewebsites.net\/api\/Givelife3CRMfunctionVolunteer?\",\n                        type: \"POST\",\n                        dataType: \"json\",\n                        data: JSON.stringify(dataToUpdate),\n                        contentType: \"application\/json\",\n                        success: function(response) {\n                            window.location.href='https:\/\/demo.givelife365.com\/fr\/intvmcreateprofile\/?id=' + response.crmVolunterID + str_plan_id;\n                        },\n                        error: function(xhr, textStatus, errorThrown) {\n                            console.error(\"Error updating data:\", textStatus, errorThrown);\n                        }\n                    });\n            }\n        });\n    <\/script>\n    \n\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2115","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/pages\/2115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/comments?post=2115"}],"version-history":[{"count":23,"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/pages\/2115\/revisions"}],"predecessor-version":[{"id":3588,"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/pages\/2115\/revisions\/3588"}],"wp:attachment":[{"href":"https:\/\/demo.givelife365.com\/fr\/wp-json\/wp\/v2\/media?parent=2115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}