Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Newsletter sign-up

JulienLach 260

@JulienLach

Desktop design screenshot for the Newsletter sign-up form with success message coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi ! I have one issue, when i click on the submit button, it doesnt redirect me to the thank page.. I can't find the issue in the JS file, anyone can help on this ? Thanks !

Community feedback

David Lee 305

@DLee1993

Posted

I'm not a 100% but i think you need to add the method "get" to the form and that will send the form data through the url and then you can get the data in js, please look into these resources for a basic explanation of how to send the data and then retrieve it in js :)

GET Method -https://www.w3schools.com/tags/att_form_method.asp#:~:text=The%20form%2Ddata%20can%20be,is%20limited%20(about%203000%20characters)

Get data from url - https://sentry.io/answers/how-to-get-values-from-urls-in-javascript/

Once you can retrieve the data, all you then need to do is append that data to the email element on the thank you page :)

Marked as helpful

0

JulienLach 260

@JulienLach

Posted

@DLee1993

Thanks you for these links !

1
David Lee 305

@DLee1993

Posted

Hey,

I believe your issue is as follows,

You currently do not have a url attached to the form for a redirect, please try the following and see if that works

<form action="thank.html" method="POST">

also, don't forget to add a link instead of a button to the thank you page ( dismiss message button ) so the user can redirect back to index

Marked as helpful

0

JulienLach 260

@JulienLach

Posted

@DLee1993

It works ! i just added "<form action="./thank.html">. Because a got a 405 error if i set the method POST.

Thanks man :)

1
David Lee 305

@DLee1993

Posted

@JulienLach

I'm glad I could help :)

Marked as helpful

0
JulienLach 260

@JulienLach

Posted

@DLee1993

And aslo changed to dismiss button, what about trying to display the email input in the span in the thank page ? Lets go !

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord