Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Why doesnt my website sub url working when submitting form but works when i manually enter it

I have a form on localhost:8080 which when you enter form data (user & pass), then press submit, it meant to send a POST to localhost:8080/submit, then should show text on that page saying "Submit page". When I enter "localhost:8080/submit" into my browser, it works, but when I use the submit button to get there, it says "This site can’t provide a secure connection" (aka, doesn't work)

script.js

const url = "https://localhost:8080";
const data = {
    "user": "user",
    "pass": "pass"
}

function send() {
    alert("Sent")
    $.post(url, data, function (data, status) {
        console.log("Sent " + data + ", status is: " + status)
    });
}
body {
    background-color: #444444;
}

.form-div {
    width: 100%;
    height: auto;
    text-align: center;
    justify-content: center;
    align-content: center;
    border: 1px solid red;
}

form {
    color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Harley Swift</title>
    <link rel='stylesheet' href='styles.css'/>
    <script type="text/javascript" src="script.js"></script>
</head>

<body>
<div class="form-div">
    <form method="POST" action="https://localhost:8080/submit">
        <div>
            <label for="user">Username</label>
            <input name="user" type="text" id="user"><br>
        </div>

        <div>
            <label for="pass">Password</label>
            <input name="pass" type="password" id="pass"><br>
        </div>
        <br>
        <div>
            <button class="btn" onclick="send()">Submit</button>
        </div>
    </form>
</div>
</body>
</html>

app.js: https://hastebin.com/udunalurub.lua (couldn't figure out how to use code snippets on here, sorry)

Thank you in advance! I am not too familiar with nodejs servers yet

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Don't use https, use http when developing locally.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!