简体   繁体   中英

How to save input data from text box to excel using pure/native JavaScript and html?

how to save inputted data from text box made in html tag to Excel file using html and pure/native JavaScript? I have two input text box, data 1 and data 2, when the user input something in those text box and click the save button, the data/value inputted will be save in existing Excel file. This Excel file has 2 columns, one for data 1 and second, for data 2.

Please help me, I'm newbie in JavaScript. I really appreciate your help. Thank you.

Here's my little code of html:

<form>
    Data 1: <input type="text" name="CA" size="75"/><br/>
    <br />
    Data 2: <input type="text" name="PA" size="75"/><br/>
    <br />
    <input type="submit" value="Save New Address"/>
</form>

Sorry,
I don't think this is possible using only JavaScript & HTML
:(

it is pure javascript

you can create an automation object (in windows) using ActiveXObject() in your javascript code. example:

var ExcelApp = new ActiveXObject("Excel.Application");
var ExcelSheet = new ActiveXObject("Excel.Sheet");
// a text is stored in the first cell  
ExcelSheet.ActiveSheet.Cells(1,1).Value = "Texto1";
// the sheet is saved
ExcelSheet.SaveAs("D:\\TEST.XLS");
// close Excel with the Quit() method of the Application object 
ExcelSheet.Application.Quit();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM