diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 096c7e9..dd3d78f 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -15,10 +15,10 @@ name, body }; - var name = document.getElementById('name'); - var body = document.getElementById('body'); + var nameValue = document.getElementById('name'); + var bodyValue = document.getElementById('body'); - if (name.value !== '' && body.value !== '') { + if (nameValue.value !== '' && bodyValue.value !== '') { try { const response = await fetch('https://helpdeskapi.mpe.ca/api/message', { method: 'POST', @@ -31,8 +31,8 @@ if (response.ok) { console.log('POST request successful'); toastr.success('One of the members of the IT department will contact you shortly', 'Message sent!'); - body.value = ''; - name.value = ''; + nameValue.value = ''; + bodyValue.value = ''; } else { console.error('Error:', response.status); toastr.error('Error: ' + response.status, 'Message not sent');