{"id":18,"date":"2026-03-10T10:11:01","date_gmt":"2026-03-10T10:11:01","guid":{"rendered":"https:\/\/learn.ranjitpalsingh.com\/student-registration\/"},"modified":"2026-03-10T10:11:01","modified_gmt":"2026-03-10T10:11:01","slug":"student-registration","status":"publish","type":"page","link":"https:\/\/ranjitpalsingh.com\/learn\/student-registration\/","title":{"rendered":"Student Registration"},"content":{"rendered":"\n<style>\n    .error {\n    color: red;\n    font-size: 12px;\n    margin-top: 4px;\n    display: block;\n}   \n<\/style>\n\n\n    <div class=\"row justify-content-center\">\n        <div class=\"col-xl-6 col-lg-7\">\n            <div id=\"tutor-registration-wrap\">\n\n                \n                <form class=\"contact-form-wrap\" method=\"post\" enctype=\"multipart\/form-data\" id=\"tutor-registration-form\">\n                    <input type=\"hidden\" name=\"tutor_course_enroll_attempt\" value=\"\">\n                    \n                    <input type=\"hidden\" id=\"_tutor_nonce\" name=\"_tutor_nonce\" value=\"54548695f0\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/learn\/wp-json\/wp\/v2\/pages\/18\" \/>                    <input type=\"hidden\" value=\"tutor_register_student\" name=\"tutor_action\" \/>\n\n                    \n                    <div class=\"tutor-form-row\">\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    First Name                                <\/label>\n\n                                <input type=\"text\" id=\"first_name\" name=\"first_name\" value=\"\" placeholder=\"First Name\" autocomplete=\"given-name\">\n                                <small class=\"error\" id=\"first_name_error\"><\/small>\n                            <\/div>\n                        <\/div>\n\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    Last Name                                <\/label>\n\n                                <input type=\"text\" id=\"last_name\" name=\"last_name\" value=\"\" placeholder=\"Last Name\" autocomplete=\"family-name\">\n                                <small class=\"error\" id=\"last_name_error\"><\/small>\n                            <\/div>\n                        <\/div>\n\n                    <\/div>\n\n                    <div class=\"tutor-form-row\">\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    User Name                                <\/label>\n\n                                <input type=\"text\" id=\"user_login\" name=\"user_login\" class=\"tutor_user_name\" value=\"\" placeholder=\"User Name\" autocomplete=\"username\">\n                                 <small class=\"error\" id=\"user_name_error\"><\/small>\n                            <\/div>\n                        <\/div>\n\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    E-Mail                                <\/label>\n\n                                <input type=\"text\" id=\"email\" name=\"email\" value=\"\" placeholder=\"E-Mail\" autocomplete=\"email\">\n                                 <small class=\"error\" id=\"email_error\"><\/small>\n                            <\/div>\n                        <\/div>\n\n                    <\/div>\n\n                    <div class=\"tutor-form-row\">\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    Password                                <\/label>\n\n                                <input type=\"password\" id=\"password\" name=\"password\" value=\"\" placeholder=\"Password\" autocomplete=\"new-password\">\n                                <small class=\"error\" id=\"password_error\"><\/small>\n                            <\/div>\n                        <\/div>\n\n                        <div class=\"tutor-form-col-6\">\n                            <div class=\"tutor-form-group\">\n                                <label>\n                                    Password confirmation                                <\/label>\n\n                                <input type=\"password\" id=\"confirm_password\" name=\"password_confirmation\" value=\"\" placeholder=\"Password Confirmation\" autocomplete=\"new-password\">\n                                <small class=\"error\" id=\"confirm_password_error\"><\/small>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n\n                    <div class=\"tutor-form-row\">\n                        <div class=\"tutor-form-col-12\">\n                            <div class=\"tutor-form-group\">\n                                                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                    \n                                        \n                    <div>\n                        <button type=\"submit\" name=\"tutor_register_student_btn\" value=\"register\" class=\"btn tutor-btn-block\">Register<\/button>\n                    <\/div>\n                    \n                <\/form>\n                \n            <\/div>\n        <\/div>\n    <\/div>\n    \n<script>\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n    const form = document.getElementById(\"tutor-registration-form\");\n\n    const firstName = document.getElementById(\"first_name\");\n    const lastName = document.getElementById(\"last_name\");\n    const userName = document.getElementById(\"user_login\");\n    const email = document.getElementById(\"email\");\n    const password = document.getElementById(\"password\");\n    const confirmPassword = document.getElementById(\"confirm_password\");\n\n    const emailRegex = \/^[^ ]+@[^ ]+\\.[a-z]{2,3}$\/;\n\n    function setError(id, message) {\n        document.getElementById(id).innerText = message;\n    }\n\n    function clearError(id) {\n        document.getElementById(id).innerText = \"\";\n    }\n\n    \/\/ \u2500\u2500 Real-time validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n    function validateFirstName() {\n        if (firstName.value.trim() === \"\") {\n            setError(\"first_name_error\", \"First name is required\");\n            return false;\n        }\n        clearError(\"first_name_error\");\n        return true;\n    }\n\n    function validateLastName() {\n        if (lastName.value.trim() === \"\") {\n            setError(\"last_name_error\", \"Last name is required\");\n            return false;\n        }\n        clearError(\"last_name_error\");\n        return true;\n    }\n\n    function validateUserName() {\n        if (userName.value.trim() === \"\") {\n            setError(\"user_name_error\", \"Username is required\");\n            return false;\n        }\n        clearError(\"user_name_error\");\n        return true;\n    }\n\n    function validateEmail() {\n        if (email.value.trim() === \"\") {\n            setError(\"email_error\", \"Email is required\");\n            return false;\n        }\n        if (!emailRegex.test(email.value)) {\n            setError(\"email_error\", \"Enter a valid email address\");\n            return false;\n        }\n        clearError(\"email_error\");\n        return true;\n    }\n\n    function validatePassword() {\n        if (password.value.length === 0) {\n            setError(\"password_error\", \"Password is required\");\n            return false;\n        }\n        if (password.value.length < 6) {\n            setError(\"password_error\", \"Minimum 6 characters required\");\n            return false;\n        }\n        clearError(\"password_error\");\n        \/\/ Re-check confirm password live if already typed\n        if (confirmPassword.value.length > 0) validateConfirmPassword();\n        return true;\n    }\n\n    function validateConfirmPassword() {\n        if (confirmPassword.value === \"\") {\n            setError(\"confirm_password_error\", \"Please confirm your password\");\n            return false;\n        }\n        if (confirmPassword.value !== password.value) {\n            setError(\"confirm_password_error\", \"Passwords do not match\");\n            return false;\n        }\n        clearError(\"confirm_password_error\");\n        return true;\n    }\n\n    \/\/ \u2500\u2500 Attach real-time events (input = while typing, blur = on leave) \u2500\u2500\n\n    firstName.addEventListener(\"input\", validateFirstName);\n    firstName.addEventListener(\"blur\", validateFirstName);\n\n    lastName.addEventListener(\"input\", validateLastName);\n    lastName.addEventListener(\"blur\", validateLastName);\n\n    userName.addEventListener(\"input\", validateUserName);\n    userName.addEventListener(\"blur\", validateUserName);\n\n    email.addEventListener(\"input\", validateEmail);\n    email.addEventListener(\"blur\", validateEmail);\n\n    password.addEventListener(\"input\", validatePassword);\n    password.addEventListener(\"blur\", validatePassword);\n\n    confirmPassword.addEventListener(\"input\", validateConfirmPassword);\n    confirmPassword.addEventListener(\"blur\", validateConfirmPassword);\n\n    \/\/ \u2500\u2500 Final check on submit \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n    form.addEventListener(\"submit\", function (e) {\n        const isValid =\n            validateFirstName() &\n            validateLastName() &\n            validateUserName() &\n            validateEmail() &\n            validatePassword() &\n            validateConfirmPassword();\n\n        if (!isValid) {\n            e.preventDefault();\n        }\n    });\n\n});\n<\/script>","protected":false},"excerpt":{"rendered":"<p>First Name Last Name User Name E-Mail Password Password confirmation Register<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-18","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/pages\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":0,"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/pages\/18\/revisions"}],"wp:attachment":[{"href":"https:\/\/ranjitpalsingh.com\/learn\/wp-json\/wp\/v2\/media?parent=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}