question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change example for Basic HTML and HTML5: Create a Form Element

See original GitHub issue

Hi there! I would like to discuss a change to the example given in the create a form element challenge. This trips up a lot of people and is always brought up in the forum.

https://forum.freecodecamp.org/search?q=create a form element after%3A2020-12-01

I think a small change to the example would help a lot of people.

Describe your problem and how to reproduce it: Existing example: <form action="/url-where-you-want-to-submit-form-data"></form> Possible change: <form action="https://submit-form-data.com"><input></form>

Using https:// at the beginning of the action will hopefully get people to correctly use the url provided. Placing the input inside the form will hopefully fix the confusion around nesting.

I think a lot of beginners look to the examples to help them with the challenges. So I think making these changes should help. While it might look like we are giving them the answer with this proposed change, there have been previous html challenges where the example was basically the answer.

https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/add-images-to-your-website https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements

Add a Link to the page with the problem: https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/create-a-form-element

Tell us about your browser and operating system:

  • Browser Name:
  • Browser Version:
  • Operating System:

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
naomi-lgbtcommented, Dec 23, 2020

<form action="/url-where-you-want-to-submit-form-data">

My only concern about changing this is that this is a common syntax when you are building a full-stack application.

Often times, you’ll have your form element send a post request to a specific endpoint on your server, which means instead of writing the full link you use /login (as an example).

1reaction
jdwilkin4commented, Dec 23, 2020

Can we do a combination of keeping the opening tag the way it is and adding the input tag to the example? <form action="/url-where-you-want-to-submit-form-data"><input></form>

Read more comments on GitHub >

github_iconTop Results From Across the Web

freeCodeCamp/create-a-form-element.md at main - GitHub
Nest the existing input element inside a form element and assign "https://www.freecatphotoapp.com/submit-cat-photo" to the action attribute of the form element.
Read more >
Your first form - Learn web development | MDN
Ok, let's have a go at creating the HTML for our form. ... In our simple example, we use the value text for...
Read more >
Basic HTML and HTML5: Create a Form Element
"The existing input element should be nested within a form element. " Could you tell me what is wrong ? I've watched video...
Read more >
HTML Form Elements - W3Schools
One of the most used form element is the <input> element. The <input> element can be displayed in several ways, depending on the...
Read more >
HTML | Design Form - GeeksforGeeks
An HTML form contains different kinds of information such as username, password, contact number, email id, etc. The elements used in an HTML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found