File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/oshohimalayas.com/include/contact-form-old-.php
Back
<script src="https://www.google.com/recaptcha/api.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.1.5/js/intlTelInput.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.1.5/css/intlTelInput.css"> <script> function timestamp() { var response = document.getElementById("g-recaptcha-response"); if (response == null || response.value.trim() == "") { var elems = JSON.parse(document.getElementsByName("captcha_settings")[0].value); elems["ts"] = JSON.stringify(new Date().getTime()); document.getElementsByName("captcha_settings")[0].value = JSON.stringify(elems); } } setInterval(timestamp, 500); </script> <style> .lead-form { max-width: 600px; margin: 0 auto; padding: 20px; } /* Use a class prefix to avoid conflicts */ .osho-form-container { /* No width setting to adapt to parent container */ padding: 20px; box-sizing: border-box; } .osho-form-title { text-align: center; font-weight: bold; font-size: 24px; margin-bottom: 5px; } .osho-form-tagline { text-align: center; color: #666; margin-bottom: 25px; } .osho-form-group { margin-bottom: 15px; display: flex; flex-direction: column; } .osho-form-container label { font-weight: bold; margin-bottom: 5px; text-align: left; } .osho-form-container input, .osho-form-container select, .osho-form-container textarea { padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; width: 100%; box-sizing: border-box; } .osho-form-container textarea { resize: vertical; min-height: 80px; } .osho-submit-btn { background-color: #0060FD; color: white; border: none; padding: 10px 20px; font-size: 16px; border-radius: 4px; cursor: pointer; margin-top: 10px; } .osho-submit-btn:hover { background-color: #0050D8; } .osho-required:after { content: " *"; color: red; } /* Specific styles for the telephone input */ .osho-form-container .iti { width: 100%; } .osho-form-container .iti__flag-container { z-index: 2; } /* Error message styling */ .phone-error { color: red; font-size: 14px; margin-top: 5px; display: none; } .input-error { border: 1px solid red !important; } </style> <div class="lead-form" id="enquiry-now"> <div class="osho-form-container"> <div class="osho-form-title">CONTACT US</div> <div class="osho-form-tagline">We are excited to hear you.</div> <form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&orgId=00DIS000002E5kI" method="POST" id="oshoContactForm"> <input type="hidden" name="captcha_settings" value='{"keyname":"oshohimalayasweb","fallback":"true","orgId":"00DIS000002E5kI","ts":""}'> <input type="hidden" name="oid" value="00DIS000002E5kI"> <input type="hidden" name="retURL" value="https://www.oshohimalayas.com/thank-you"> <!-- Hidden lead source with default value "Website" --> <input type="hidden" id="lead_source" name="lead_source" value="Website"> <!-- Hidden field to store the full phone number (country code + number) --> <input type="hidden" id="fullPhoneNumber" name="mobile"> <div class="osho-form-group"> <label for="last_name" class="osho-required">Your Name</label> <input id="last_name" maxlength="80" name="last_name" size="20" type="text" required /> </div> <div class="osho-form-group"> <label for="phone" class="osho-required">Phone (preferably WhatsApp number)</label> <input id="phone" type="tel" required /> <span id="phone-error" class="phone-error">For Indian numbers, please enter exactly 10 digits</span> </div> <div class="osho-form-group"> <label for="email" class="osho-required">Email</label> <input id="email" maxlength="80" name="email" size="20" type="email" required /> </div> <div class="osho-form-group"> <label for="00NIS000003kBiM" class="osho-required">Let us know about your plan</label> <textarea id="00NIS000003kBiM" name="00NIS000003kBiM" rows="3" wrap="soft" required></textarea> </div> <div class="osho-form-group"> <label for="00NIS000003kBiC" class="osho-required">How did you hear about us?</label> <select id="00NIS000003kBiC" name="00NIS000003kBiC" title="How did you hear about us?" required> <option value="">--Please Select--</option> <option value="Google search">Google search</option> <option value="From friends/other people">From friends/other people</option> <option value="Previously been to Osho Himalayas">Previously been to Osho Himalayas</option> <option value="Facebook">Facebook</option> <option value="Instagram">Instagram</option> <option value="Youtube">Youtube</option> <option value="Others">Others</option> </select> </div> <div class="g-recaptcha" data-sitekey="6LdNEvAqAAAAACwVatBPs8ZbgxsiQie924lhe5Tg"></div> <input type="submit" name="submit" value="Submit" class="osho-submit-btn"> </form> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { // Initialize the telephone input plugin var input = document.querySelector("#phone"); var phoneError = document.getElementById('phone-error'); var iti = window.intlTelInput(input, { initialCountry: "in", // Set India as the default country separateDialCode: true, utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.1.5/js/utils.js" }); // Function to validate phone number function validatePhoneNumber() { input.classList.remove('input-error'); phoneError.style.display = 'none'; // Check if India is selected if (iti.getSelectedCountryData().iso2 === 'in') { // Get the phone number without country code var phoneNumber = input.value.replace(/\D/g, ''); // Remove non-digits // For India, we need exactly 10 digits if (phoneNumber.length !== 10) { input.classList.add('input-error'); phoneError.style.display = 'block'; return false; } } return true; } // Validate on input change input.addEventListener('input', validatePhoneNumber); // Validate when country changes input.addEventListener('countrychange', function() { validatePhoneNumber(); }); // Before submitting the form, validate and set the value of the hidden field document.getElementById('oshoContactForm').addEventListener('submit', function(e) { if (!validatePhoneNumber()) { e.preventDefault(); // Prevent form submission if validation fails return false; } var fullNumber = iti.getNumber(); // This gets the full number with country code document.getElementById('fullPhoneNumber').value = fullNumber; }); }); </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings