How to save information from javascript to Microsoft Access database?

I would like to save my user’s input to a database.

In my project from my studies I encountered a problem saving information in the javascript language .

I founded a function on the internet that captures the variable and converts it to a string
to json file, but it didnt create the file with the input.

the function :

         let account= [];
        const addAccount = (ev)=>{
            ev.preventDefault();  //to stop the form submitting
            let accounts = {
            document.forms[0].reset(); // to clear the form for the next entries
            //for display purposes only
            console.warn('added' , {accounts} );
            let pre = document.querySelector('#msg pre');
            pre.textContent = 'n' + JSON.stringify(accounts, 't', 2);
            //saving to localStorage
            localStorage.setItem('MyAccountList', JSON.stringify(accounts) );
        document.addEventListener('DOMContentLoaded', ()=>{
            document.getElementById('btn').addEventListener('click', addAccount);

of course I allready have an register order in the same HTML file.

So the question is how I save at data in local storage in json file ?

Thank you.

Source: JavaSript – Stack Overflow

November 28, 2021
Category : News
Tags: database | html | javascript

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.