-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3339c36
commit 5d55786
Showing
3 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Emily Hartz-Kuzmicz | ||
job346 | ||
11350337 | ||
CMPT281 | ||
*/ | ||
|
||
let slideIndex = 1; | ||
displaySlides(slideIndex); | ||
|
||
/* | ||
Changes the image based on which (< >) button is pressed. | ||
Parameters: | ||
n: An integer to add to slideIndex, then pass to | ||
displaySlides to show the new image. | ||
*/ | ||
function changeSlides(n) { | ||
displaySlides(slideIndex += n); | ||
} | ||
|
||
/* | ||
Displays a single carousel image. | ||
Parameters: | ||
n: An integer index value to access the image in the | ||
array of carousel images. | ||
*/ | ||
function displaySlides(n) { | ||
let i; | ||
let slides = document.getElementsByClassName("CarouselImage"); | ||
|
||
//If the index is greater than the array length | ||
if (n > slides.length) { | ||
slideIndex = 1; | ||
|
||
//If the index is smaller than the smallest array index | ||
} else if (n < 1) { | ||
slideIndex = slides.length; | ||
} | ||
|
||
//Sets all images to display=none | ||
for (i = 0; i < slides.length; i++) { | ||
slides[i].style.display = "none"; | ||
} | ||
|
||
//Shows a single image | ||
slides[slideIndex-1].style.display = "initial"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
Emily Hartz-Kuzmicz | ||
job346 | ||
11350337 | ||
CMPT281 | ||
*/ | ||
|
||
/* | ||
Submits the form on the "Booking" Page. | ||
*/ | ||
function formSubmit() { | ||
let loginForm = document.getElementById("Form"); | ||
|
||
loginForm.addEventListener("submit", (e) => { | ||
e.preventDefault(); | ||
|
||
//Take in all data from form | ||
let fname = document.getElementById("fname"); | ||
let lname = document.getElementById("lname"); | ||
let phonenum = document.getElementById("phonenum"); | ||
let email = document.getElementById("email"); | ||
let returning_patient, contact_method; | ||
|
||
//Check which radio button is selected for returning patient | ||
if (document.getElementById("returning_patientyes").checked) { | ||
returning_patient = "yes"; | ||
} else { | ||
returning_patient = "no"; | ||
} | ||
|
||
//Check which radio button is selected for contact method | ||
if (document.getElementById("contact_methodphone").checked) { | ||
contact_method = "phone"; | ||
} else { | ||
contact_method = "email"; | ||
} | ||
|
||
let day = document.getElementById("day"); | ||
let time = document.getElementById("time"); | ||
let message = document.getElementById("message"); | ||
|
||
//If any of the required field values are empty | ||
if (fname.value == "" || lname.value == "" || phonenum.value == "" || email.value == "" || message.value == "") { | ||
alert("The following values cannot be empty: First Name, Last Name, Phone Number, Email."); | ||
|
||
} else { | ||
alert("Your appointment request has been successfully submitted!"); | ||
|
||
//Log the given data to the console | ||
console.log( | ||
`First Name: ${fname.value}\nLast Name: ${lname.value}\nPhone Number: ${phonenum.value}\nEmail: ${email.value}\n` | ||
); | ||
|
||
console.log( | ||
`Returning Patient: ${returning_patient}\nContact Method: ${contact_method}\n` | ||
); | ||
|
||
console.log( | ||
`Requested Day: ${day.value}\nRequested Time: ${time.value}\nMessage: ${message.value}\n` | ||
); | ||
|
||
//Set all values back to empty | ||
fname.value = ""; | ||
lname.value = ""; | ||
phonenum.value = ""; | ||
email.value = ""; | ||
|
||
day.value = "monday"; | ||
time.value = "9"; | ||
message.value = ""; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Emily Hartz-Kuzmicz | ||
job346 | ||
11350337 | ||
CMPT281 | ||
*/ | ||
|
||
/* | ||
Submits the form on the "Contact Us" Page. | ||
*/ | ||
function formSubmit() { | ||
let loginForm = document.getElementById("Form"); | ||
|
||
loginForm.addEventListener("submit", (e) => { | ||
e.preventDefault(); | ||
|
||
//Take in all data from form | ||
let fname = document.getElementById("fname"); | ||
let lname = document.getElementById("lname"); | ||
let phonenum = document.getElementById("phonenum"); | ||
let email = document.getElementById("email"); | ||
let subject = document.getElementById("subject"); | ||
let message = document.getElementById("message"); | ||
|
||
//If any of the required field values are empty | ||
if (fname.value == "" || lname.value == "" || phonenum.value == "" || email.value == "" || subject.value == "" || message.value == "") { | ||
alert("The following values cannot be empty: First Name, Last Name, Phone Number, Email, Subject, Message."); | ||
|
||
} else { | ||
alert("Your contact request has been successfully submitted!"); | ||
|
||
//Log the given data to the console | ||
console.log( | ||
`First Name: ${fname.value}\nLast Name: ${lname.value}\nPhone Number: ${phonenum.value}\nEmail: ${email.value}\nSubject: ${subject.value}\nMessage: ${message.value}` | ||
); | ||
|
||
//Set all values back to empty | ||
fname.value = ""; | ||
lname.value = ""; | ||
phonenum.value = ""; | ||
email.value = ""; | ||
subject.value = ""; | ||
message.value = ""; | ||
} | ||
}); | ||
} |