From 08375cfd766eb72d96f112aa361f0e7b9875d4b8 Mon Sep 17 00:00:00 2001 From: arfhad-shaikh Date: Thu, 29 Jul 2021 12:10:38 -0700 Subject: [PATCH] update --- cgi/cgi_test.pl | 47 +++++++++++++++++++++++++++-------------------- style.css | 6 +++--- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/cgi/cgi_test.pl b/cgi/cgi_test.pl index 904251f..17917a6 100755 --- a/cgi/cgi_test.pl +++ b/cgi/cgi_test.pl @@ -46,7 +46,7 @@ - +

@@ -65,7 +65,7 @@ var result = ""; if(weight > 0 && height > 0){ var BMI = Math.round(weight/(height/100*height/100)); -document.getElementById("BMI").innerHTML = BMI; +document.getElementById("BMI").innerHTML = "Your BMI is" + BMI; if(BMI < 18.5){ document.getElementById("BMI-result").innerHTML= "You are too thin."; result="That you are too thin."; @@ -82,31 +82,38 @@ else{ alert("Please Fill in everything correctly"); } -document.body.innerHTML += "" } +document.body.innerHTML += "" + function sendEmail() { result = document.getElementById("BMI-result").innerText; bmi = document.getElementById("BMI").innerText; - Email.send({ - Host: "smtp.elasticemail.com", - Username : "account_validation\@learn.taliaq.com", - Password : "8CDE0ED2F1E5FA245FBCD6EE5B35CD9D0942", - To : "$data{email}", - From :"theolaanstra\@gmail.com", - Subject : "BMI Results", - Body : "Hi \\n Your BMI result says that \\"" + result + "\\"\\r\\nYour BMI is " + bmi - }).then( - function(message) { - console.log("Email Status: " + message); - if (message == "OK") { - document.body.innerHTML += "
Email sent - check your junk folder!"; - } else { - document.body.innerHTML += "
" + message; - } + if (result == "" && bmi == "") + { + alert("Enter Height & Weight"); } - ); + else{ + Email.send({ + Host: "smtp.elasticemail.com", + Username : "account_validation\@learn.taliaq.com", + Password : "8CDE0ED2F1E5FA245FBCD6EE5B35CD9D0942", + To : "$data{email}", + From :"theolaanstra\@gmail.com", + Subject : "BMI Results", + Body : "Hi \\n Your BMI result says that \\"" + result + "\\"\\r\\nYour BMI is " + bmi + }).then( + function(message) { + console.log("Email Status: " + message); + if (message == "OK") { + document.body.innerHTML += "
Email sent - check your junk folder!"; + } else { + document.body.innerHTML += "
" + message; + } + } + ); } +} diff --git a/style.css b/style.css index 0249284..375dcf8 100644 --- a/style.css +++ b/style.css @@ -227,7 +227,7 @@ pre { } /* -------------------Contact Form--------------------------*/ - input[type=text], select, textarea, input[type=password], input[type=email]{ + input[type=text], select, textarea, input[type=password], input[type=email], input[type=number]{ width: 100%; padding: 12px; border: 1px solid #ccc; @@ -277,7 +277,7 @@ li.active > button.nav-button { }*/ /* Full-width input fields */ -input[type=text], input[type=password], input[type=email] { +input[type=text], input[type=password], input[type=email], input[type=number]{ width: 100%; padding: 15px; margin: 5px 0 22px 0; @@ -287,7 +287,7 @@ input[type=text], input[type=password], input[type=email] { } /* Add a background color when the inputs get focus */ -input[type=text]:focus, input[type=password]:focus, input[type=email]:focus { +input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=number] { background-color: #ddd; outline: none; }