add form logic to script.js
This commit is contained in:
parent
da8df0a5c9
commit
3ea94000f0
1 changed files with 20 additions and 0 deletions
20
public/js/script.js
Normal file
20
public/js/script.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
document.getElementById('uploadForm').addEventListener('submit', async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const formData = new FormData(this);
|
||||
const outputSection = document.getElementById('outputSection');
|
||||
const coverLetterOutput = document.getElementById('coverLetterOutput');
|
||||
const generateBtn = document.getElementById('generateBtn');
|
||||
const downloadBtn = document.getElementById('downloadBtn');
|
||||
|
||||
|
||||
generateBtn.disabled = true;
|
||||
generateBtn.textContent = "Generating...";
|
||||
coverLetterOutput.value = ""; //This clear any previous generated output
|
||||
|
||||
// Show the Output Section while the program runs
|
||||
outputSection.style.display = "block";
|
||||
coverLetterOutput.value = "Generating cover letter...";
|
||||
|
||||
|
||||
})
|
Loading…
Reference in a new issue