javascript write to text file
function WriteToFile(passForm) {
set fso = CreateObject("Scripting.FileSystemObject");
set s = fso.CreateTextFile("<your Path>/filename.txt", True);
var firstName = document.getElementById('FirstName');
var lastName = document.getElementById('lastName');
s.writeline("First Name :" + FirstName);
s.writeline("Last Name :" + lastName);
s.writeline("-----------------------------");
s.Close();
}
// HTML
<form onSubmit="WriteToFile(this)">
<label>Type your first name:</label>
<input type="text" name="FirstName" id="firstName" size="20">
<label>Type your last name: </abel>
<input type="text" name="LastName" id="lastName" size="20">
<input type="submit" value="submit">
</form>
Also in JavaScript:
- data table in angular 8 from api
- onchange event angular select
- JavaScript append HTML
- new features of angular 11
- count the number of spacesinto a string javascript
- remove object in array javascript
- jspdf Cannot create property 'callback' on number '15'
- led brightness website nodemcu
- react native flexbox 2 columns 1 fixed width
- nodejs btoa
- js async await
- capitalize
- react fun tion
- pi in js
- npm create react app
- <FilterProvider> errorr
- javascript check if element has class
- function isValidWalk(walk)
- abstraction in javascript
- Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
- javascript date
- edit html element javascript
- js math random
- object destructuring into this