# HTML Form inputs stored inputs data to Excel sheet

**URL:** <https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724>\
**Category:** Curriculum Help\
**Tags:** html, css\
**Created:** [April 3, 2020, 7:05pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724 "2020-04-03T19:05:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:05pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/1 "2020-04-03T19:05:24Z")

</div>

Continuing the discussion from [Form To Excel Sheet](http://forum.freecodecamp.org/t/form-to-excel-sheet/212933):

Please I am seeking for help on how to store my HTML form inputs to excel sheet or excel database.

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [April 3, 2020, 7:15pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/2 "2020-04-03T19:15:17Z")

</div>

Hello and welcome to the forum 🙂!

On the link you reference is a response to what you’re asking, what’s the problem you’re currently having? Are there any errors?

Otherwise I’d point you to, for example, this [Excel JavaScript library](https://github.com/SheetJS/sheetjs), which will help you parse and generate the books.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:20pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/3 "2020-04-03T19:20:24Z")

</div>

I didn’t even no steps to take but I do know how to design form input but the of excel I do not know where to start on how to connect my form to excel sheet.

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [April 3, 2020, 7:25pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/4 "2020-04-03T19:25:28Z")

</div>

Oh, OK.

In that case, you should start by learning JavaScript and HTML, otherwise you won’t get far.

You should start with:

- [Free Code Camp’s Responsive Web Design](https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/) and then
- [Free Code Camp’s JavaScript Algorithms and Data Structures](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/).

That should give you the basics to create what you need 🙂.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:28pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/5 "2020-04-03T19:28:30Z")

</div>

Alright but why do I need Javascript?

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [April 3, 2020, 7:33pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/6 "2020-04-03T19:33:35Z")

</div>

Good question!

It depends. I assumed (shame on me 😅) you wanted to create the excel book directly on the browser, in which case you have no other option than to learn JavaScript.

Now, if you want to send the data to the server and there create the book, then it will depend on your server side language.

The only common part is that you would need a library that reads/writes the excel books and, with it, create the books.

**You cannot** (AFAIK) create an excel book directly from the `input`s on your form.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:35pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/7 "2020-04-03T19:35:27Z")

</div>

How will I do that with Javascript ? Please can you help me with an example of what you said.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 3, 2020, 7:42pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/8 "2020-04-03T19:42:19Z")

</div>

JavaScript is what makes websites _do things_. If you want an interactive website, then you need to learn JavaScript.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:56pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/9 "2020-04-03T19:56:59Z")

</div>

Are you trying to say that is in JavaScript that I will put the code that store input data to excel sheet?

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 3, 2020, 7:57pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/10 "2020-04-03T19:57:59Z")

</div>

JavaScript is the language you will write your code in.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 7:58pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/11 "2020-04-03T19:58:13Z")

</div>

Are you trying to say that is in JavaScript that I will put the instruction code that store input data to excel sheet?

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 8:00pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/12 "2020-04-03T20:00:34Z")

</div>

OK. I got it now. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 8:14pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/13 "2020-04-03T20:14:46Z")

</div>

Please want to know if I should created my excel database first? How should I save my excel sheet? And also should I create excel folder in same folder with HTML and CSS?.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 3, 2020, 8:15pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/14 "2020-04-03T20:15:29Z")

</div>

Honestly, if you want to build this yourself from scratch, you’re going to need to spend a long time learning the fundamentals of web programming first.

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 8:19pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/15 "2020-04-03T20:19:49Z")

</div>

Am using Bracket file to program.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 3, 2020, 8:20pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/16 "2020-04-03T20:20:29Z")

</div>

Ok.

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [April 3, 2020, 8:36pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/17 "2020-04-03T20:36:00Z")

</div>

Sure, but if you don’t know JavaScript you may not be able to understand it.

Here it is, [a simple example using SheetJS](https://jsfiddle.net/skaparate/dv1pjusr/27/) to create a simple book from two inputs:

```auto
<label>Name: <input type="text" id="name" value="John" /></label><br />
<label>Last Name: <input type="text" id="lastName" value="Doe" /></label><br />
<button id="saveBook" type="button">
  Save
</button>

```

```javascript
function saveBook() {
  const name = document.getElementById('name').value;
  const lastName = document.getElementById('lastName').value;

  if (!name || !lastName) {
    return;
  }
  
  // A multidimensional array represents the data.
  // Each array is a new row and each item on the
  // array is a different column (cell).
  const data = [
    // A B
    ["Name", "Last Name"], // Row 1
    [name, lastName] // Row 2
    // Row N
  ];

  // Creates the sheet data
  const ws = XLSX.utils.aoa_to_sheet(data);
  // Create a new book where to append the data.
  const wb = XLSX.utils.book_new();
  
  // Append the sheet (second param) to the book (first param)
  // with the specified name (third param)
  XLSX.utils.book_append_sheet(wb, ws, "Test Sheet");
  
  // This is the instruction that tells the browser to
  // "download" the file
  XLSX.writeFile(wb, 'book.xlsx');
}

document.querySelector('#saveBook').onclick = saveBook;

```

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 3, 2020, 8:43pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/18 "2020-04-03T20:43:09Z")

</div>

Thanks but what will I save my excel sheet with? I mean file name.

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [April 3, 2020, 8:47pm UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/19 "2020-04-03T20:47:11Z")

</div>

That’s up to you. You haven’t specified any kind of context or what you’re trying to achieve.

If the example I gave is enough, then the name is not important. When the browser asks to save the file, it will use _book.xlsx_ (in the sample).

---

<div class="post-metadata">

**Author:** ![Blessed1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Blessed1](https://forum.freecodecamp.org/u/Blessed1)\
**Post date:** [April 5, 2020, 9:04am UTC](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724/20 "2020-04-05T09:04:48Z")

</div>

Alright. I just want to design a website and it will be containing registration from and I want to be able to see names of those that have registered and to see the names of those people I have to create a database where their names will store. I just need the HTML form code link to excel database.

[Next page](https://forum.freecodecamp.org/t/html-form-inputs-stored-inputs-data-to-excel-sheet/367724.md?page=2)
