DEV Community

Petrus van Eeden
Petrus van Eeden

Posted on

Page error 405.

This page isn't working at the moment
If the problem continues, contact the site owner.
HTTP ERROR 405
here is my script for html as well as javascript.

Here is the html.

<!DOCTYPE html>





<title>Business Registration Form</title>



Business Registration Form



First Name:

      <div class="input-group">
        <label><strong>Last Name:</strong></label>
        <input type="text" placeholder="Last Name" id="last_name" required>
      </div>

      <div class="input-group">
        <label><strong>Business Name:</strong></label>
        <input type="text" placeholder="Business Name" id="business_name" required>
      </div>

      <div class="input-group">
        <label><strong>Business Address:</strong></label>
        <input type="text" placeholder="Enter Your Business Address" id="business_address" required>
      </div>

      <div class="input-group">
        <label><strong>Reg.Nr:</strong></label>
        <input type="text" placeholder="Optional" id="registration-number">
      </div>

      <div class="input-group">
        <label><strong>Vat Nr.:</strong></label>
        <input type="text" placeholder="Optional" id="vat-number">
      </div>

      <div class="input-group">
        <label><strong>City/Town</strong></label>
        <input type="text" placeholder="Enter Your City" id="city" required> 
      </div>

      <div class="input-group">
        <label><strong>Province:</strong></label>
          <select class="form-control" id="province" name="province" required>
            <option value="Select">Select</option>
            <option value="Gauteng">Gauteng</option>
            <option value="Western Cape">Western Cape</option>
            <option value="KwaZulu-Natal">KwaZulu-Natal</option>
            <option value="Eastern Cape">Eastern Cape</option>
            <option value="Free State">Free State</option>
            <option value="Limpopo">Limpopo</option>
            <option value="Mpumalanga">Mpumalanga</option>
            <option value="North West">North West</option>
            <option value="Northern Cape">Northern Cape</option>
          </select>
      </div>

      <div class="input-group">
        <label><strong>Business Start Date:</strong></label>
        <input type="date" id="date" required>
      </div> 

      <div class="input-group">
        <label><strong>Email:</strong></label>
        <input type="email" placeholder="Enter Your Email" id="email" aria-describedby="emailHelp" required>
        <span id="emailError" class="error-message"></span>
        <span id="emailHelp" class="sr-only"></span>
      </div>

      <div class="input-group">
        <label><strong>Mobile Nr.:</strong></label>
        <input type="tel" placeholder="Enter your mobile number" id="phone-nr" required>
      </div>

      <div class="input-group">
        <label><strong>Work Nr.:</strong></label>
        <input type="tel" placeholder="Enter your work number" id="work-nr" required>
      </div>

      <div class="input-group">
        <label><strong>Gender:</strong></label>
        <input type="radio" style="flex-basis: 0%; margin: 5px;" name="gender" value="male" id="male" required>
        <label for="male">Male</label> 
        <input type="radio" style="flex-basis: 0%; margin: 5px;"name="gender" value="female" id="female" required>
        <label for="female">Female</label>  
      </div>

      <div class="input-group">
        <label><strong>Password:</strong></label>
        <input type="text" placeholder="Enter Your Password" id="password" required>
      </div>  

    <button onclick="return validateForm()">Submit</button>
    <span id="submit-error"></span>
    </form>
    <footer>
      <div class="footer-content">
          <p>By signing up, you agree to our<br> <a href="#terms" id="terms-link">Terms and Conditions</a>, <br><a href="#privacy" id="privacy-link">Privacy Policy</a>, and<br> <a href="#copyright" id="copyright-link">Copyright Notice</a>.</p>
          </div>
          </footer>
          <!-- Terms and Conditions Modal -->
          <div id="terms" class="modal">
          <div class="modal-content">
              <span class="close">Close</span>
              <h2>Terms and Conditions</h2>
              <p>Welcome to South African Biz Hub!</p>
              <p>These terms and conditions outline the rules and regulations for the use of South African Biz Hub's Website.</p>
              <h2>1. Terms</h2>
              <p>By accessing this website we assume you accept these terms and conditions. Do not continue to use South African Biz Hub if you do not agree to take all of the terms and conditions stated on this page.</p>
              <h2>2. License</h2>
              <p>Unless otherwise stated, South African Biz Hub and/or its licensors own the intellectual property rights for all material on South African Biz Hub. All intellectual property rights are reserved. You may access this from South African Biz Hub for your own personal use subjected to restrictions set in these terms and conditions.</p>
              <h2>3. User Comments</h2>
              <p>Certain parts of this website offer the opportunity for users to post and exchange opinions and information in certain areas of the website. South African Biz Hub does not filter, edit, publish or review Comments prior to their presence on the website. Comments do not reflect the views and opinions of South African Biz Hub, its agents and/or affiliates. Comments reflect the views and opinions of the person who post their views and opinions.</p>
              <h2>4. Hyperlinking to our Content</h2>
              <p>The following organizations may link to our Website without prior written approval: Government agencies; Search engines; News organizations; Online directory distributors may link to our Website in the same manner as they hyperlink to the Websites of other listed businesses; and System wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site.</p>
              <h2>5. iFrames</h2>
              <p>Without prior approval and written permission, you may not create frames around our Webpages that alter in any way the visual presentation or appearance of our Website.</p>
              <h2>6. Content Liability</h2>
              <p>We shall not be hold responsible for any content that appears on your Website. You agree to protect and defend us against all claims that is rising on your Website. No link(s) should appear on any Website that may be interpreted as, obscene or criminal, or which infringes, otherwise violates, or advocates the infringement or other violation of, any third party rights.</p>
              <h2>7. Your Privacy</h2>
              <p>Please read Privacy Policy</p>
              <h2>8. Reservation of Rights</h2>
              <p>We reserve the right to request that you remove all links or any particular link to our Website. You approve to immediately remove all links to our Website upon request. We also reserve the right to amend these terms and conditions and its linking policy at any time. By continuously linking to our Website, you agree to be bound to and follow these linking terms and conditions.</p>
              <h2>9. Removal of links from our website</h2>
              <p>If you find any link on our Website that is offensive for any reason, you are free to contact and inform us any moment. We will consider requests to remove links but we are not obligated to or so or to respond to you directly.</p>
              <h2>10. Disclaimer</h2>
              <p>To the maximum extent permitted by applicable law, we exclude all representations, warranties and conditions relating to our website and the use of this website. Nothing in this disclaimer will:</p>
              <ul>
                  <li>limit or exclude our or your liability for death or personal injury;</li>
                  <li>limit or exclude our or your liability for fraud or fraudulent misrepresentation;</li>
                  <li>limit any of our or your liabilities in any way that is not permitted under applicable law; or</li>
                  <li>exclude any of our or your liabilities that may not be excluded under applicable law.</li>
              </ul>
              <p>The limitations and prohibitions of liability set in this Section and elsewhere in this disclaimer: (a) are subject to the preceding paragraph; and (b) govern all liabilities arising under the disclaimer, including liabilities arising in contract, in tort and for breach of statutory duty.</p>
              <p>As long as the website and the information and services on the website are provided, we will not be liable for any loss or damage of any nature.</p><!-- Add the rest of your terms and conditions here -->
              </div>
              </div>
              <!-- Privacy Policy Modal -->
              <div id="privacy" class="modal">
              <div class="modal-content">
              <span class="close">Close</span>
              <h2>Privacy Policy</h2>
              <p>At South African Biz Hub, one of our main priorities is the privacy of our visitors.</p>
              <p>This Privacy Policy document contains types of information that is collected and recorded by South African Biz Hub and how we use it.</p>
                <h2>1. Log Files</h2>
                <p>South African Biz Hub follows a standard procedure of using log files. These files log visitors when they visit websites. All hosting companies do this and a part of hosting services' analytics. The information collected by log files include internet protocol (IP) addresses, browser type, Internet Service Provider (ISP), date and time stamp, referring/exit pages, and possibly the number of clicks. These are not linked to any information that is personally identifiable. The purpose of the information is for analysing trends, administering the site, tracking users' movement on the website, and gathering demographic information.</p>
                <h2>2. Cookies and Web Beacons</h2>
                <p>Like any other website, South African Biz Hub uses 'cookies'. These cookies are used to store information including visitors' preferences, and the pages on the website that the visitor accessed or visited. The information is used to optimize the users' experience by customizing our web page content based on visitors' browser type and/or other information.</p>
                <h2>3. Google DoubleClick DART Cookie</h2>
                <p>Google is a third-party vendor on our site. It also uses cookies, known as DART cookies, to serve ads to our site visitors based upon their visit to www.website.com and other sites on the internet. However, visitors may choose to decline the use of DART cookies by visiting the Google ad and content network Privacy Policy at the following URL – <a href="https://policies.google.com/technologies/ads">https://policies.google.com/technologies/ads</a></p>
                <h2>4. Our Advertising Partners</h2>
                <p>Some of the advertisers on our site may use cookies and web beacons. Each of our advertising partners has their own Privacy Policy for their policies on user data. For easier access, we hyperlinked to their Privacy Policies below.</p>
                <ul>
                <li>Google: <a href="https://policies.google.com/technologies/ads">https://policies.google.com/technologies/ads</a></li>
                </ul>
                <h2>5. Privacy Policies</h2>
                <p>You may consult this list to find the Privacy Policy for each of the advertising partners of South African Biz Hub.</p>
                <h2>6. Third Party Privacy Policies</h2>
                <p>South African Biz Hub's Privacy Policy does not apply to other advertisers or websites. Thus, we are advising you to consult the respective Privacy Policies of these third-party ad servers for more detailed information. It may include their practices and instructions about how to opt-out of certain options.</p>
                <h2>7. CCPA Privacy Rights (Do Not Sell My Personal Information)</h2>
                <p>Under the CCPA, among other rights, South African consumers have the right to:</p>
                <ul>
                    <li>Request that a business that collects a consumer's personal data disclose the categories and specific pieces of personal data that a business has collected about consumers.</li>
                    <li>Request that a business delete any personal data about the consumer that a business has collected.</li>
                    <li>Request that a business that sells a consumer's personal data, not sell the consumer's personal data.</li>
                </ul>
                <p>If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please contact us.</p>
                <h2>8. GDPR Data Protection Rights</h2>
                <p>We would like to make sure you are fully aware of all of your data protection rights. Every user is entitled to the following:</p>
                <ul>
                <li>The right to access – You have the right to request copies of your personal data.<!-- Add the rest of your privacy policy here -->
             </div>
             </div>
             <!-- Copyright Notice Modal -->
             <div id="copyright" class="modal">
             <div class="modal-content">
             <span class="close">Close</span>
             <h2>Copyright Notice</h2>
             <h3>© 2024 South African Biz Hub. All rights reserved.</h3><br>
             This app and its content, including but not limited to text, graphics, logos, and software, are the property of South African Biz Hub and are protected by international copyright laws. Unauthorized use, reproduction, or distribution of this material is prohibited.</p>
              </div>
              </div>
              <script src="/js/register.js"></script>
            </body>
           </html>

Here is the java.
document.addEventListener('DOMContentLoaded', function() {

document.getElementById('registrationForm').addEventListener('submit', function(event) {
    event.preventDefault();
    var firstname = document.getElementById('first name').value;
    var password = document.getElementById('password').value;
    var email = document.getElementById('email').value;

    if (firstname === '' || password === '' || email === '') {
        alert('All fields are required!');
    } else {
        alert('Registration successful!');
        // Here you can add code to submit the form data to the server
    }
});
// Validate Email
function validateEmail() {
    var email = document.getElementById('email').value;
    var emailError = document.getElementById('emailError');
    if (email.length == 0) {
        emailError.innerHTML = ' **Email is required';
        return false;
    }
    if (!email.match(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/)) {
        emailError.innerHTML = ' **Invalid Email';
        return false;
    }
    emailError.innerHTML = ''; // Clear error if valid
    return true;
}

// Validate PinCode
function validatePinCode() {
    var passWord = document.getElementById('passWord').value;
    var passWordError = document.getElementById('passWordError');
    if (passWord.length == 0) {
        passWordError.innerHTML = ' **Password is required';
        return false;
    }
    if (passWord.length !== 6) {
        passWordError.innerHTML = ' **Password should be of 6 digits';
        return false;
    }
    if (!passWord.match(/^[0-9]{6}$/)) {
        passWordError.innerHTML = ' **Only digits please';
        return false;
    }
    passWordError.innerHTML = ''; // Clear error if valid
    return true;
}

// Province Dropdown Change Event
const provinceDropdown = document.getElementById('province');
provinceDropdown.addEventListener('change', function() {
    const selectedProvince = this.value;
    console.log('Selected province:', selectedProvince);
});

// Modal Functionality
function setupModal(modalId, linkId) {
    const modal = document.getElementById(modalId);
    const link = document.getElementById(linkId);
    const closeBtn = modal.querySelector('.close');

    function openModal() {
        modal.style.display = 'block';
    }

    function closeModal() {
        modal.style.display = 'none';
    }

    link.addEventListener('click', function(event) {
        event.preventDefault();
        openModal();
    });

    closeBtn.addEventListener('click', closeModal);

    window.addEventListener('click', function(event) {
        if (event.target === modal) {
            closeModal();
        }
    });
}

setupModal('terms', 'terms-link');
setupModal('privacy', 'privacy-link');
setupModal('copyright', 'copyright-link');

});

I keep getting this message when I click on submit. Please help guys, I'm very new to this. I would really appreciate if you could solve this. Thank you.

Top comments (0)