Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
HTML Write to .txt File

I'm making a file in HTML to be run in Edge (just on my computer), and I want to have a string of text be input into an existing .txt file. I'm very new to scripting, and can't get any php's fwrite() or JS' writeFile() to work in Edge. After searching and testing for a few hours, any help you could offer would be awesome!

This is an example I got off another Stack page, but it simply won't run when not commented out.

Thanks!

<!DOCTYPE html>
<html>
<head>
</head>
<script language="Javascript" >

/*function WriteToFile(passForm) { 

    set fso = CreateObject("Scripting.FileSystemObject");  
    set s   = fso.CreateTextFile("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(); 
 } */

function tester(){
    alert("This part works");}



</script>

<body>

<button onclick="tester();">Alert Test</button>

<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> 

</body>
</html>
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!