{"id":414,"date":"2026-06-16T09:46:24","date_gmt":"2026-06-16T09:46:24","guid":{"rendered":"https:\/\/sinomedassist.com\/?page_id=414"},"modified":"2026-06-16T15:19:37","modified_gmt":"2026-06-16T15:19:37","slug":"pre-consultation-form","status":"publish","type":"page","link":"https:\/\/sinomedassist.com\/ar\/pre-consultation-form\/","title":{"rendered":"\u0627\u062d\u062c\u0632 \u0627\u0633\u062a\u0634\u0627\u0631\u062a\u0643 \u0627\u0644\u0645\u062c\u0627\u0646\u064a\u0629"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"414\" class=\"elementor elementor-414\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-25d9c9a e-con e-atomic-element e-flexbox-base e-92c13d3 \" data-id=\"25d9c9a\" data-element_type=\"e-flexbox\" data-e-type=\"e-flexbox\" data-interaction-id=\"25d9c9a\" data-e-type=\"e-flexbox\" data-id=\"25d9c9a\">\n    \t\t<div class=\"elementor-element elementor-element-215ea9b elementor-widget elementor-widget-html\" data-id=\"215ea9b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\n    document.addEventListener('DOMContentLoaded', function () {\n  const wizardForm = document.getElementById('cf7-wizard-form');\n  if (!wizardForm) return;\n\n  const sections = wizardForm.querySelectorAll('.wizard-section');\n  const btnPrev = wizardForm.querySelector('.btn-prev');\n  const btnNext = wizardForm.querySelector('.btn-next');\n  const submitContainer = wizardForm.querySelector('.form-submit-container');\n  const progressFill = wizardForm.querySelector('.progress-fill');\n  const txtCurrentStep = wizardForm.querySelector('.current-step-txt');\n  \n  let currentStep = 1;\n  const totalSteps = 5;\n  const mobileBreakpoint = 767;\n\n  function checkResponsiveState() {\n    const isMobile = window.innerWidth <= mobileBreakpoint;\n    \n    if (isMobile) {\n      sections.forEach(section => {\n        const stepNum = parseInt(section.getAttribute('data-step'), 10);\n        if (stepNum === currentStep) {\n          section.classList.add('active-step');\n        } else {\n          section.classList.remove('active-step');\n        }\n      });\n      updateControlsUI();\n    } else {\n      \/\/ Desktop: Show all sections and the submit action, remove wizard overrides\n      sections.forEach(section => {\n        section.classList.remove('active-step');\n      });\n      submitContainer.style.display = 'block';\n    }\n  }\n\n  function updateControlsUI() {\n    if (window.innerWidth > mobileBreakpoint) return;\n\n    if (txtCurrentStep) txtCurrentStep.textContent = currentStep;\n    \n    if (progressFill) {\n      const fillPercentage = (currentStep \/ totalSteps) * 100;\n      progressFill.style.width = fillPercentage + '%';\n    }\n\n    \/\/ Previous Button visibility states\n    if (currentStep === 1) {\n      btnPrev.setAttribute('disabled', 'true');\n      btnPrev.style.visibility = 'hidden';\n    } else {\n      btnPrev.removeAttribute('disabled');\n      btnPrev.style.visibility = 'visible';\n    }\n\n    \/\/ Next vs Submit visibility toggle logic\n    if (currentStep === totalSteps) {\n      btnNext.style.setProperty('display', 'none', 'important');\n      submitContainer.style.display = 'inline-block';\n    } else {\n      btnNext.style.setProperty('display', 'inline-flex', 'important');\n      submitContainer.style.display = 'none';\n    }\n  }\n\n  function validateCurrentStepFields() {\n    let isValid = true;\n    const activeSection = wizardForm.querySelector(`.wizard-section[data-step=\"${currentStep}\"]`);\n    if (!activeSection) return true;\n\n    const targetFields = activeSection.querySelectorAll('input, select, textarea');\n    \n    targetFields.forEach(field => {\n      const isRequired = field.hasAttribute('aria-required') && field.getAttribute('aria-required') === 'true';\n      const isRadioOrCheckbox = field.type === 'radio' || field.type === 'checkbox';\n      \n      field.classList.remove('input-validation-error');\n      \n      if (isRequired) {\n        if (isRadioOrCheckbox) {\n          const fieldGroupWrapper = field.closest('.complex-field') || field.closest('.wpcf7-form-control-wrap');\n          if (fieldGroupWrapper) {\n            const checkedCount = fieldGroupWrapper.querySelectorAll('input:checked').length;\n            if (checkedCount === 0) {\n              isValid = false;\n              fieldGroupWrapper.classList.add('input-validation-error');\n            } else {\n              fieldGroupWrapper.classList.remove('input-validation-error');\n            }\n          }\n        } else {\n          if (!field.value || field.value.trim() === \"\") {\n            isValid = false;\n            field.classList.add('input-validation-error');\n          }\n        }\n      }\n    });\n\n    if (!isValid) {\n      const firstInvalidField = activeSection.querySelector('.input-validation-error, :invalid');\n      if (firstInvalidField) {\n        firstInvalidField.scrollIntoView({ behavior: 'smooth', block: 'center' });\n      }\n    }\n\n    return isValid;\n  }\n\n  function scrollToFormTop() {\n    wizardForm.scrollIntoView({ behavior: 'smooth', block: 'start' });\n  }\n\n  btnNext.addEventListener('click', function (e) {\n    e.preventDefault();\n    if (window.innerWidth <= mobileBreakpoint) {\n      if (validateCurrentStepFields()) {\n        if (currentStep < totalSteps) {\n          sections.forEach(section => section.classList.remove('active-step'));\n          currentStep++;\n          \n          const nextActiveSection = wizardForm.querySelector(`.wizard-section[data-step=\"${currentStep}\"]`);\n          if (nextActiveSection) nextActiveSection.classList.add('active-step');\n          \n          updateControlsUI();\n          scrollToFormTop();\n        }\n      }\n    }\n  });\n\n  btnPrev.addEventListener('click', function (e) {\n    e.preventDefault();\n    if (window.innerWidth <= mobileBreakpoint) {\n      if (currentStep > 1) {\n        sections.forEach(section => section.classList.remove('active-step'));\n        currentStep--;\n        \n        const prevActiveSection = wizardForm.querySelector(`.wizard-section[data-step=\"${currentStep}\"]`);\n        if (prevActiveSection) prevActiveSection.classList.add('active-step');\n        \n        updateControlsUI();\n        scrollToFormTop();\n      }\n    }\n  });\n\n  window.addEventListener('resize', checkResponsiveState);\n  checkResponsiveState();\n});\n<\/script>\t\t\t\t<\/div>\n\t\t\n<\/div>\n\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Step 1 of 5 Personal Information Full Name * Gender * Select GenderMaleFemaleOtherPrefer not to say Date of Birth * Nationality * Country of Residence * Phone \/ WhatsApp Number * Email Address * Preferred Language * Medical Information What medical condition would you like us to review? * Have you already received a diagnosis? [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-414","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/pages\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":17,"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/pages\/414\/revisions"}],"predecessor-version":[{"id":459,"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/pages\/414\/revisions\/459"}],"wp:attachment":[{"href":"https:\/\/sinomedassist.com\/ar\/wp-json\/wp\/v2\/media?parent=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}