Home
Support Forums

I deploy my website but can't open the page 404 error for when i try to click on enter function

I deploy my website. but I get a 404 error when I click on Enter and trying to go to the next page. here is my site. What seems to be the problem, guys ?

https://competent-goldstine-e54fa8.netlify.app/

Hi @bobby007

In essence the problem is the page return.html does not exist.

How did you deploy (drag and drop, git, cli)?
Have you tried downloading the deployed files to ensure everything is there and where it is expected?

@coolmay Yes, I have downloaded the zip files and match my folder with the downloaded folder all the files are there.

@coelmay I did drag N drop and, why it says return.html doesn’t exist when the file is there and it works in my local environment.

While the page return.html exists, sending a POST request to it from a form does not work.

thanks, but how can I fix that?

There are many ways. As you already have a JavaScript function to save the name value to local storage, you can extend that function to handle the form submission and redirect the user. Also a good idea to check there is a value in the name—currently you can click enter without filling out the name field.

well, the function works if you go on the top corner and click on the home button you can see the return page with the value you have typed in the form input. it just doesn’t work when I click enter.

The Home link is a standard anchor <a> tag which navigates to the location specified in the href attribute. The JavaScript function is not initiated. That is why is works.

If you remove the action and method attributes from the <form>, change the <button> to an <a> and remove type="submit" you should find it works.

@coelmay Nope, Still not working.

This worked for me.

<form class="login">
  <h3 class="name">Enter your Name</h3>
  <input class="input" type="text" color="#fff" id="name" name="name" placeholder="Enter name..."> 
  <a class="btn" href="return.html" onclick="passvalue()">Enter</a>
</form>

OMG!! you’re freaking Genius . It works thank you so much .

1 Like

Keep in mind though, you have no checks to see if a name was entered and if someone clicks the Home link at the top of page no name gets stored in Local Storage either.

1 Like

Yes, I have removed the link from Home. It was just for the test purpose. Thanks again

1 Like