0

i create a < form > in html how i declare or it into js

in this code NRC2 i try to link the first page with next page but in sololearn it doesn't work. Do I need to link the pages in js? https://code.sololearn.com/WjZtj6Wr8fh8/?ref=app

20th May 2020, 3:38 AM
Arun
Arun - avatar
7 ответов
20th May 2020, 5:46 AM
BroFar
BroFar - avatar
+ 2
Your form needs attributes to be submitted. You can also use AJAX in JavaScript using the FormData object or regular AJAX. I usually put a container or a div element with an id to replace the HTML with the resulting HTML that comes from the backend file using innerHTML. If you meant to get the form element on JS then there are lots of ways to get that element but the easiest is var form = document.getElementById("form_id"); on JS. On HTML <form id="form_id"> You can then use the inner stuff included in that form for any reason you want it. Take the JavaScript course here which will help you get more ideas.
20th May 2020, 4:17 AM
carlos mercado
carlos mercado - avatar
+ 2
Arun You can simply create a hyperlink as a button here as if you are going to the next page ... each code playground has it's own url identifier so page two literally is the beginning of another code bit. Another option or two is create a medal page portal or create one long page (later to be shortened) and use internal linking from one section to the next.
20th May 2020, 4:22 AM
BroFar
BroFar - avatar
+ 1
Thanks BroFar 👍👍
20th May 2020, 6:06 AM
Arun
Arun - avatar
0
Arun can you explain what you are trying to do so we, the community, can assist you better. At this point your question appears to be unclear. Thanks and happy coding. https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community
20th May 2020, 4:04 AM
BroFar
BroFar - avatar
0
in this code NRC2 i try to connect first page with next page but in sololearn it not done so i think for connect the pages i declare the form in js
20th May 2020, 4:13 AM
Arun
Arun - avatar
0
BroFar can you attach a code for guidance
20th May 2020, 4:36 AM
Arun
Arun - avatar