0
method="post" work in Sololearn?
I'm trying to submit my form using post method in Sololearn but it's not working,like it's not saving submitted information on my server
17 ответов
+ 2
Yes, it works from Sololearn as long there is a connected server.
Please share your code.
+ 1
For cross domain access, your server needs to enable CORS.
0
https://code.sololearn.com/W6ZANiuC80cD/?ref=app
new link with iframe:- https://code.sololearn.com/W5GpOh6Ho3Nv/?ref=app
0
It works on heroku website but not in Sololearn
0
I have a form post request to my Glitch.com server, it works very well.
https://code.sololearn.com/Wj7yW7R4iSId/?ref=app
0
You have any idea what's wrong in my shared code?
0
For form submit, event.preventDefault() is needed.
0
Hi thnx i already enabled cors,but it was not working on heroku but it worked for glitch idk why 😂
still not working
0
If i use prevent default then use will stay on form page and maybe they will send it multiple times
0
Try to add fetch with .then(response => response.json()).then(data => console.log(data)).catch( e => console.log("error " + e.message))
To debug any error on fetch.
0
Ok i will try that
0
Server app.post of '/postQuote' should response a json from callback back to client for acknowledgement.
0
Ooh yeah i will try that i was not sending any response
0
When i make post request and catch err it's showing TypeErro: failed to fetch
0
I ended up using iframe (-_-)
0
Post method is more secure although but when you click on submit the back-end part (web application server and the database ) comes in the part of Nest JS.Take the course of Angular +Nest JS on sololearn before working on back-end part.