So I was making a form with Bootstrap today and ran into an issue where I didn’t see the form data when it is submitted to the url as a get request.
I couldn’t figure out why this was happening so I did some digging and eventually copy and pasted enough example forms to find one that works.
I will try to implement the solution into the example form in the Bootstrap documentation
The solution is very simple. The Bootstrap documentation does not define a name attribute on the input elements. All you need to do is add a name attribute for every field and the data will submit as usual.
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" />
Just becomes this:
<input type="email" name="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" />
More on this attribute can be found on w3schools. This isn’t really Bootstrap’s fault but it would’ve been nice if the docs defined the name attribute.
Full code can be found at: https://github.com/fosteeco/Bootstrap-form-testing .
The deployment on github pages is here: https://fosteeco.github.io/Bootstrap-form-testing/ .
Hopefully you don’t spend a lot of time trying to figure this out. Another thing I’ve been finding is that when you search for Bootstrap on duckduckgo a lot of the time it is Bootstrap 4 as the first result. If you try using Bootstrap 4 stuff you’ll have issues so make sure you’re using the correct docs. They probably should make the sites look different from each other to prevent confusion.
Also shouldn’t search through the actual documentation instead of using a search engine.
Look how similar these pages look tho
That New Version message at the top should have more emphasis. Oh well, we live and learn. Always make sure you’re using the right docs…