Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make the following changes and include comments -When the calculate tuition and

ID: 3912834 • Letter: M

Question

Make the following changes and include comments

-When the calculate tuition and fees button is clicked it should ask if the student would like to apply to the university
-If they hit OK a validation function should run that calls the functions to validate the form. If the form validates a alert displays saying the information has been submitted and that someone from the university will contact them via email. Use the template attached as the action attribute in the form tag.
  
-If the cancel button is clicked a alert appears that says no information has been submitted to the university

-Validate that first & last name has been entered
-Validate that an email address has been entered that isn't numeric
-Validate that a tuition type has been chosen
-Validate that the number of credits is numeric and has been entered
-Validate that a major has been selected
  
-If an item fails validation an alert will appear explaining the issue and the form contents will remain available for modification and then to resubmit
  
  
-If they click the reset button a confirm message appears
-If they press OK the form resets
-If they press cancel the form remains the same w/ all data still present

-Validate the code at https://validator.w3.org/ and fix any errors

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Tuition Calculator</title>
<!-- Styles -->
<!-- The below style is for the margins -->

<style>
table {
margin: 0 auto;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
</head>

<body>
<!-- CalU title and image -->
<img src="logo.png" alt="CalU logo"
>
<table>

<tr>
<!-- Sub title -->
<td><h3>Tuition Calculator</h3></td>
<td></td>
</tr>
<form>
<tr>
<td>Student Name</td>
<!-- Input student name -->
<!-- Calls studentname variable from js.js -->

<td><input id="sname" name="sname" /></td>
</tr>

<tr>
<td>Email Address</td>
<!-- Input Email ID -->
<!-- Calls emailid variable from js.js -->

<td><input type="email" id="emailid" name="emailid" /></td>
</tr>

<tr>
<td>Tuition Type</td>
<td><input type="radio" id="instate1" name="tuition_type"
value="In-State" /> In-State
<input type="radio"
id="outofstate1" name="tuition_type" value="Out-of-State" />

Out-of-State
<input type="radio" id="international1"
name="tuition_type" value="International tuition " /> International
tuition</td>
</tr>

<!-- Financial Add Check BOX -->
<tr>
<td>Financial Aid</td>
<td>
<input type="checkbox" name="finance" value="">
</td>
</tr>


<tr>
<td>Full-time/Part-time</td>
<td><input type="radio" id="fulltime1" name="time"
value="Full-time" /> Full-time <input type="radio"
id="parttime1" name="time" value="Part-time" /> Part-time</td>
</tr>

<tr>
<!-- Displays a text box -->
<!-- When a user clicks on the radio buttons it becomes filled in -->

<td>Number of credits</td>
<td><input type="text" name="credits" id="credits" /></td>
</tr>

<tr>
<td>Major</td>
<td>

<!-- Displays radio buttons --> <!-- When a user clicks on the radio buttons it becomes filled in -->
<select name="major" id="major">
<option id="CIS" value="CIS">Computer & Information Systems</option>
<option id="Business" value="Business"> Business Management </option>
<option id="Economics" value="Economics"> Economics</option>
<option id="Finance" value="Finance"> Finance</option>
<option id="General" value="General"> General Education</option>

<!-- Change the names according to Yor Wish -->
<!-- Accordingly make changes in js displayAlert()-->
<option id="maj6" value="maj6"> Data Science</option>
<option id="maj7" value="maj7"> Artificial Intelligence</option>
<option id="maj8" value="maj8"> Mechanical Engineering</option>
<option id="maj9" value="maj9"> Embedded System</option>
<option id="maj10" value="maj10"> Electrical Engineering</option>
</select>

</td>
</tr>

<tr>
<td></td>

<td>
<!-- Displays a submit button for calculating your tuition --> <!-- This actuates the program to calculate the tuition based on the input previously gathered -->
<input type="submit" value="Submit"
/>
<input type="reset" value="Reset"><!-- Reset Button -->
<button type="button">Cancel</button>
</td>

</tr>
</form>
<tr>
<td></td>
<td>
<!-- Displays the result as a result of clicking the submit button -->
<span id="result"></span>
</td>
</tr>
</table>
<br>
<br>
<br>
<!-- Google Map for CalU -->
<div id="map"></div>

<script>
function myMap() {
var mapCanvas = document.getElementById("map");
var mapOptions = {
center : new google.maps.LatLng(40.064416, -79.884218),
zoom : 17
};
var map = new google.maps.Map(mapCanvas, mapOptions);
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBb7-XZU_SPwHme6yNhYRMpiDmRE73GVjw&amp;callback=myMap"></script>
<script>

$(function(){
$('input[type="radio"]').click(function(){
if ($(this).is(':checked'))
{
alert($(this).val());
}
});
});
</script>
<script src="variables.js"></script>
</body>
</html>

JAVASCRIPT JS FILE

function getTutitonType() {

if (document.getElementById("instate1").checked) {

return "In-State";

} else if (document.getElementById("outofstate1").checked) {

return "Out-of-State";

} else if (document.getElementById("international1").checked) {

return "International Tuition "

}

return "";

}

// Full time or part time

function getFullTimeOrPartTime() {

var fulltime1 = document.getElementById("fulltime1").checked;

var parttime1 = document.getElementById("parttime1").checked;

if (fulltime1) {

return "Full Time";

} else if (parttime1) {

return "Part Time";

}

return "";

}

// Majors

function getMajor() {

major=String(document.getElementById("major").value);

if (major=="CIS") {

return "Computer & Information Systems";

}

else if (major=="Business") {

return "Business";

}

else if (major=="Economics") {

return "Economics";

}

else if (major=="Finance") {

return "Finance";

}

else if (major=="General") {

return "General Education";

}

else if (major=="maj6") {

return "Data Science";

}

else if (major=="maj7") {

return "Artificial Intelligence";

}

else if (major=="maj8") {

return "Mechanical Engineering";

}

else if (major=="maj9") {

return "Embedded System";

}

else if (major=="maj10") {

return "Electrical Engineering";

}

return "";

}

//Displays Alert when an option is selected

function displayAlert() {

major=String(document.getElementById("major").value);

if (major=="CIS") {

alert('Computer & Information Systems majors are great for people who enjoy computers, coding, networking, and databases.');

}

else if (major=="Business") {

alert('Business Management degrees can get you a wide range of jobs and require you to have a lot of knowledge in finance, economics, or accounting.');

}

else if (major=="Economics") {

alert('An economics degree can et you positoins in a wide range of positions related to finance and technology.');

}

else if (major=="Finance") {

alert('The finance degree involves helping businesses and consumers organize money.');

}

else if (major=="General") {

alert('This choice will let you take a few classes to better gauge what you would like your degree to be in.');

}

else if (major=="maj6") {

alert('A Data Science degree helps you to gain expertisse in big data.');

}

else if (major=="maj7") {

alert('An Artificial Intelligence Degree helps to understand machine intelligence');

}

else if (major=="maj8") {

alert('Mechanical Engineering helps you understand basic mechanism and principles behind various machines');

}

else if (major=="maj9") {

alert('Embedded System degree will help one to design embedded smart systems.');

}

else if (major=="maj10") {

alert('An Electrical Engineering degree will help you to deal with various electrical components and circuits.');

}

else{

alert('Please Select a valid Major');

}

}

// This gets the information for displaying a summary of everything on the form as an alert

function buildStudentProfile() {

var name = document.getElementById('sname').value;

var emailid = document.getElementById('emailid').value;

var credits = document.getElementById("credits").value;

var str = "Student Name: " + name + ' ';

str += "Email ID: " + emailid + ' ';

str += "Tuition Type: " + getTutitonType() + ' ';

str += "Fulltime or part time: " + getFullTimeOrPartTime() + ' ';

str += "Number of credits: " + credits + ' ';

str += "Major: " + getMajor() + ' ';

return str;

}

//This function hides the amount on pressing reset button

function hideResult() {

document.getElementById("result").style.visibility = "hidden";

}

function result() {

// Full time & part time variables

var fulltime1 = document.getElementById("fulltime1").checked;

var parttime1 = document.getElementById("parttime1").checked;

// This variables prints the results

var confirmation = confirm("Are you sure want to print results?");

// Credits variable

var credits = document.getElementById("credits").value;

// In state

// In state full time arrays for tuition

var instft=[3746,232,33.20]

// In state part time arrays for tuition

var instpt=[312,20,33.20]

// In state variable to calculate the credits

var instate1 = document.getElementById("instate1").checked;

// Out of state

// Out of state full time arrays for tuition

var oosft=[5619,353,49.80]

// Out of state part time arrays for tuition

var oospt=[468,30,49.80]

// Out of state variable to calculate the credits

var outofstate1 = document.getElementById("outofstate1").checked;

// International

// International full time arrays for tuition

var ift=[7305,353,63.90];

// International part time arrays for tuition

var ipt=[609,30,63.90];

// International variable to calculate the credits

var international1 = document.getElementById("international1").checked;

var name = document.getElementById('sname').value;

// This line will print the results if the confirmation is true

if(confirmation===true)

{

var results;

var secondConfirmation;

// In state full time

if(instate1==true && fulltime1==true && credits>=12 && credits<=18)

{

results=(instft[2]*credits)+(instft[0]+instft[1]);

secondConfirmation = confirm(buildStudentProfile() + ((instft[2]*credits)+(instft[0]+instft[1])));

}

// In state part time

else if(instate1==true && parttime1==true && credits<12)

{

results=(credits*instpt[0])+(credits*instpt[1])+(credits*instpt[2]);

secondConfirmation = confirm(buildStudentProfile() + ((credits*instpt[0])+(credits*instpt[1])+(credits*instpt[2])));

}

// Out of state full time

else if(outofstate1==true && fulltime1==true && credits>=12 && credits<=18)

{

results=(oosft[2]*credits)+(oosft[0]+oosft[1]);

secondConfirmation = confirm(buildStudentProfile() + ((oosft[2]*credits)+(oosft[0]+oosft[1])));

}

// Out of state part time

else if(outofstate1==true && parttime1==true && credits<12)

{

results=(credits*oospt[0])+(credits*oospt[1])+(credits*oospt[2]);

secondConfirmation = confirm(buildStudentProfile() + ((credits*oospt[0])+(credits*oospt[1])+(credits*oospt[2])));

}

// International full time

else if(international1==true && fulltime1==true && credits>=12 && credits<=18)

{

results=(ift[2]*credits)+(ift[0]+ift[1]);

secondConfirmation = confirm(buildStudentProfile() + ((ift[2]*credits)+(ift[0]+ift[1])));

}

// International part time

else if(international1==true && parttime1==true && credits<12)

{

results=(credits*ipt[0])+(credits*ipt[1])+(credits*ipt[2]);

secondConfirmation = confirm(buildStudentProfile() + (credits*ipt[0])+(credits*ipt[1])+(credits*ipt[2]));

}

else if (secondConfirmation === false) {

alert('Correct any errors on the form.');

secondConfirmation = true;

}

else{

alert('Correct any errors on the form.');

}

var name = document.getElementById("sname").value;

document.getElementById("result").innerHTML = name +" would owe <b>$"+ results + "</b>";

}

else{

alert('Correct any errors on the form.');

}

}

FORM PROCESSOR TEMPLATE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Form Processor</title>

<meta http-equiv="content-type" content="text/html;

charset=iso-8859-1" />

<link rel="stylesheet" href="js_styles.css" type="text/css" />

</head>

<body>

<script type="text/javascript">

/* <![CDATA[ */

document.write("<h1>Your form has been submitted!</h1><h2>You entered the following data:</h2>");

var formData = location.search;

formData = formData.substring(1, formData.length);

while (formData.indexOf("+") != -1) {

formData = formData.replace("+", " ");

}

formData = unescape(formData);

var formArray = formData.split("&");

for (var i=0; i < formArray.length; ++i) {

document.writeln(formArray[i] + "<br />");

}

/* ]]> */

</script>

</body>

</html>

Explanation / Answer

HTML

<!DOCTYPE html>
<html lang="en">

<head>
<title>Tuition Calculator</title>
<!-- Styles -->

<meta charset="utf-8">
<!-- The below style is for the margins -->
<script src="chegg.js"></script>
<style>
table {
margin: 0 auto;
}

img {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
</head>

<body>
<!-- CalU title and image -->
<img src="logo.png" alt="CalU logo">
<!-- method get is used to pass the params via url -->
<!-- on submmit in used for invoke a function while submitting a form -->
<!-- form is submitted if only if validateForm() returns true -->
<form method="GET" action="chegg1.html" name="CalU">
<table>

<tr>
<!-- Sub title -->
<td>
<h3>Tuition Calculator</h3>
</td>
<td></td>
</tr>
  
<tr>

<!-- Input student name -->
<!-- Calls studentname variable from js.js -->

<td>
FristName&nbsp;&nbsp;&nbsp;
<input id="fname" name="fname" />
<!-- added a input field for firstname -->

</td>
<td>
LastName&nbsp;&nbsp;&nbsp;
<input id="lname" name="lname" />
<!-- added a input field for lastname -->
</td>
</tr>

<tr>
<td>Email Address</td>
<!-- Input Email ID -->
<!-- Calls emailid variable from js.js -->

<td>
<input type="email" id="emailid" name="emailid" />

</td>
</tr>

<tr>
<td>Tuition Type</td>
<td>
<input type="radio" id="instate1" name="tuition_type" value="In-State" /> In-State
<input type="radio" id="outofstate1" name="tuition_type" value="Out-of-State" /> Out-of-State
<input type="radio" id="international1" name="tuition_type" value="International tuition " /> International tuition

</td>
</tr>

<!-- Financial Add Check BOX -->
<tr>
<td>Financial Aid</td>
<td>
<input type="checkbox" name="finance" value="">
</td>
</tr>


<tr>
<td>Full-time/Part-time</td>
<td>
<input type="radio" id="fulltime1" name="time" value="Full-time" /> Full-time
<input type="radio" id="parttime1" name="time" value="Part-time" /> Part-time</td>
</tr>

<tr>
<!-- Displays a text box -->
<!-- When a user clicks on the radio buttons it becomes filled in -->

<td>Number of credits</td>
<td>
<input type="text" name="credits" id="credits" />
<span class="err" id="creditsErr">

</span>
</td>
</tr>

<tr>
<td>Major</td>
<td>

<!-- Displays radio buttons -->
<!-- When a user clicks on the radio buttons it becomes filled in -->
<select name="major" id="major">
<option selected disabled value="">Select the Major</option>
<option id="CIS" value="CIS">Computer & Information Systems</option>
<option id="Business" value="Business"> Business Management </option>
<option id="Economics" value="Economics"> Economics</option>
<option id="Finance" value="Finance"> Finance</option>
<option id="General" value="General"> General Education</option>

<!-- Change the names according to Yor Wish -->
<!-- Accordingly make changes in js displayAlert()-->
<option id="maj6" value="maj6"> Data Science</option>
<option id="maj7" value="maj7"> Artificial Intelligence</option>
<option id="maj8" value="maj8"> Mechanical Engineering</option>
<option id="maj9" value="maj9"> Embedded System</option>
<option id="maj10" value="maj10"> Electrical Engineering</option>
</select>

</td>
</tr>

<tr>
<td></td>

<td>
<!-- Displays a submit button for calculating your tuition -->
<!-- This actuates the program to calculate the tuition based on the input previously gathered -->
<input type="submit" value="Submit" />

<input type="reset" value="Reset">
<!-- Reset Button -->
<button type="button">Cancel</button>
</td>

</tr>
  
<tr>
<td></td>
<td>

</td>
</tr>
</table>
</form>
<!-- Displays the result as a result of clicking the submit button -->
<span id="result"></span>


<br>
<br>
<br>
<!-- Google Map for CalU -->
<div id="map"></div>

<script>
function myMap() {
var mapCanvas = document.getElementById("map");
var mapOptions = {
center: new google.maps.LatLng(40.064416, -79.884218),
zoom: 17
};
var map = new google.maps.Map(mapCanvas, mapOptions);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBb7-XZU_SPwHme6yNhYRMpiDmRE73GVjw&amp;callback=myMap"></script>
<script>

// $(function(){
// $('input[type="radio"]').click(function(){
// if ($(this).is(':checked'))
// {
// alert($(this).val());
// }
// });
// });
/// you should include jquery use above function but there is no jquery is included so it's causes an error

</script>

</body>

</html>

JAVASCRIPT JS FILE

function validateForm() {
//this function is used to validate the form
//we considered form name CalU
//@form is refers the form present in html we are accessing that with it's name


var form = document.forms["CalU"];//acccess form with the name
var fname = form["fname"].value;//acccess firstname value using by name=fname parameter
var lname = form["lname"].value;//acccess lastname value using by name=lname parameter
var email = form["emailid"].value;//acccess email value using by name=emailid parameter
var tuition_type = form["tuition_type"].value;//acccess tuition_type value using by name=tuition_type parameter
var credits = form["credits"].value;//acccess credits value using by name=credits parameter
var major = form["major"].value;//acccess major value using by name=major parameter
var emailpatt = /^[_a-zA-ZáéíñóúüÁÉÍÑÓÚÜ0-9-]+(.[_a-zA-ZáéíñóúüÁÉÍÑÓÚÜ0-9-]+)*@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*(.[a-zA-Z]{2,4})$/;//regular expression for global email address
var validationReport="";// all error are append to this string intially we don't have no errors so it is empty


if (fname == null || fname == undefined || fname == "") {

validationReport+="[*]FirstName is Required*"+" ";//if firstname is not entered


} else {
  
}
if (lname == null || lname == undefined || lname.length <= 0) {

validationReport+="[*]LastName is Required*"+" ";//if lastname is not entered

} else {

}
if (email == null || email == undefined || email.length <= 0) {
  
validationReport+="[*]Email is Required*"+" ";//if email is not entered

} else if (!emailpatt.test(email)) {
  
validationReport+="[*]Invalid Email"+" ";//if invalid email is not entered

} else {
  
}
if (tuition_type == null || tuition_type == undefined || tuition_type.length <= 0) {
  
validationReport+="[*]Tuition Type is required*"+" ";//if Tuition Type is not entered

} else {
  
}

if (credits == null || credits == undefined || credits == "") {
  
validationReport+="[*]credits Field is Required*"+" ";//if credits are not entered
  
} else if (isNaN(credits)) {
  
validationReport+="[*]Credits should be numerical"+" ";//if Non numerical credits are not entered

} else {
  
}

if (major == null || major == undefined || major == "") {
validationReport+="[*]Major is required*"+" ";//if Major is not selected
  
} else {
var major1=getMajor();
if(major1==""){
validationReport+="[*]Invalid Major is selected"+" ";//if Major is not selected form the listed above

}else{
  
}
}

if(validationReport==""){
//if validation errors
var a=confirm("Are you sure to Submit?");
if(a==true){
//user confrim to submit
return true;
}else{
//user press cancel to submit
return false;
}
}else{
//If validation Errors are there we presenting them with a alert
alert("Validations is Failed: "+validationReport);
return false;
}

  

  
}


function getTutitonType() {

if (document.getElementById("instate1").checked) {

return "In-State";

} else if (document.getElementById("outofstate1").checked) {

return "Out-of-State";

} else if (document.getElementById("international1").checked) {

return "International Tuition "

}

return "";

}

// Full time or part time

function getFullTimeOrPartTime() {

var fulltime1 = document.getElementById("fulltime1").checked;

var parttime1 = document.getElementById("parttime1").checked;

if (fulltime1) {

return "Full Time";

} else if (parttime1) {

return "Part Time";

}

return "";

}

// Majors

function getMajor() {

major = String(document.getElementById("major").value);

if (major == "CIS") {

return "Computer & Information Systems";

}

else if (major == "Business") {

return "Business";

}

else if (major == "Economics") {

return "Economics";

}

else if (major == "Finance") {

return "Finance";

}

else if (major == "General") {

return "General Education";

}

else if (major == "maj6") {

return "Data Science";

}

else if (major == "maj7") {

return "Artificial Intelligence";

}

else if (major == "maj8") {

return "Mechanical Engineering";

}

else if (major == "maj9") {

return "Embedded System";

}

else if (major == "maj10") {

return "Electrical Engineering";

}

return "";

}

//Displays Alert when an option is selected

function displayAlert() {

major = String(document.getElementById("major").value);

if (major == "CIS") {

alert('Computer & Information Systems majors are great for people who enjoy computers, coding, networking, and databases.');

}

else if (major == "Business") {

alert('Business Management degrees can get you a wide range of jobs and require you to have a lot of knowledge in finance, economics, or accounting.');

}

else if (major == "Economics") {

alert('An economics degree can et you positoins in a wide range of positions related to finance and technology.');

}

else if (major == "Finance") {

alert('The finance degree involves helping businesses and consumers organize money.');

}

else if (major == "General") {

alert('This choice will let you take a few classes to better gauge what you would like your degree to be in.');

}

else if (major == "maj6") {

alert('A Data Science degree helps you to gain expertisse in big data.');

}

else if (major == "maj7") {

alert('An Artificial Intelligence Degree helps to understand machine intelligence');

}

else if (major == "maj8") {

alert('Mechanical Engineering helps you understand basic mechanism and principles behind various machines');

}

else if (major == "maj9") {

alert('Embedded System degree will help one to design embedded smart systems.');

}

else if (major == "maj10") {

alert('An Electrical Engineering degree will help you to deal with various electrical components and circuits.');

}

else {

alert('Please Select a valid Major');

}

}

// This gets the information for displaying a summary of everything on the form as an alert

function buildStudentProfile() {

var name = document.getElementById('sname').value;

var emailid = document.getElementById('emailid').value;

var credits = document.getElementById("credits").value;

var str = "Student Name: " + name + ' ';

str += "Email ID: " + emailid + ' ';

str += "Tuition Type: " + getTutitonType() + ' ';

str += "Fulltime or part time: " + getFullTimeOrPartTime() + ' ';

str += "Number of credits: " + credits + ' ';

str += "Major: " + getMajor() + ' ';

return str;

}

//This function hides the amount on pressing reset button

function hideResult() {

document.getElementById("result").style.visibility = "hidden";

}

function result() {

// Full time & part time variables

var fulltime1 = document.getElementById("fulltime1").checked;

var parttime1 = document.getElementById("parttime1").checked;

// This variables prints the results

var confirmation = confirm("Are you sure want to print results?");

// Credits variable

var credits = document.getElementById("credits").value;

// In state

// In state full time arrays for tuition

var instft = [3746, 232, 33.20]

// In state part time arrays for tuition

var instpt = [312, 20, 33.20]

// In state variable to calculate the credits

var instate1 = document.getElementById("instate1").checked;

// Out of state

// Out of state full time arrays for tuition

var oosft = [5619, 353, 49.80]

// Out of state part time arrays for tuition

var oospt = [468, 30, 49.80]

// Out of state variable to calculate the credits

var outofstate1 = document.getElementById("outofstate1").checked;

// International

// International full time arrays for tuition

var ift = [7305, 353, 63.90];

// International part time arrays for tuition

var ipt = [609, 30, 63.90];

// International variable to calculate the credits

var international1 = document.getElementById("international1").checked;

var name = document.getElementById('sname').value;

// This line will print the results if the confirmation is true

if (confirmation === true) {

var results;

var secondConfirmation;

// In state full time

if (instate1 == true && fulltime1 == true && credits >= 12 && credits <= 18) {

results = (instft[2] * credits) + (instft[0] + instft[1]);

secondConfirmation = confirm(buildStudentProfile() + ((instft[2] * credits) + (instft[0] + instft[1])));

}

// In state part time

else if (instate1 == true && parttime1 == true && credits < 12) {

results = (credits * instpt[0]) + (credits * instpt[1]) + (credits * instpt[2]);

secondConfirmation = confirm(buildStudentProfile() + ((credits * instpt[0]) + (credits * instpt[1]) + (credits * instpt[2])));

}

// Out of state full time

else if (outofstate1 == true && fulltime1 == true && credits >= 12 && credits <= 18) {

results = (oosft[2] * credits) + (oosft[0] + oosft[1]);

secondConfirmation = confirm(buildStudentProfile() + ((oosft[2] * credits) + (oosft[0] + oosft[1])));

}

// Out of state part time

else if (outofstate1 == true && parttime1 == true && credits < 12) {

results = (credits * oospt[0]) + (credits * oospt[1]) + (credits * oospt[2]);

secondConfirmation = confirm(buildStudentProfile() + ((credits * oospt[0]) + (credits * oospt[1]) + (credits * oospt[2])));

}

// International full time

else if (international1 == true && fulltime1 == true && credits >= 12 && credits <= 18) {

results = (ift[2] * credits) + (ift[0] + ift[1]);

secondConfirmation = confirm(buildStudentProfile() + ((ift[2] * credits) + (ift[0] + ift[1])));

}

// International part time

else if (international1 == true && parttime1 == true && credits < 12) {

results = (credits * ipt[0]) + (credits * ipt[1]) + (credits * ipt[2]);

majorirmation = confirm(buildStudentProfile() + (credits * ipt[0]) + (credits * ipt[1]) + (credits * ipt[2]));
}
else if (secondConfirmation === false) {

alert('Correct any errors on the form.');

secondConfirmation = true;

}

else {

alert('Correct any errors on the form.');

}

var name = document.getElementById("sname").value;

document.getElementById("result").innerHTML = name + " would owe <b>$" + results + "</b>";

}

else {

alert('Correct any errors on the form.');

}

}

FORM PROCESSOR TEMPLATE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Form Processor</title>

<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />

<link rel="stylesheet" href="js_styles.css" type="text/css" />

</head>

<body>

<script type="text/javascript">

/* <![CDATA[ */

document.write("<h1>Your form has been submitted!</h1><h2>You entered the following data:</h2>");
alert("Someone From our University will contact you via Email.")
var formData = location.search;

formData = formData.substring(1, formData.length);

while (formData.indexOf("+") != -1) {

formData = formData.replace("+", " ");

}

formData = unescape(formData);

var formArray = formData.split("&");

for (var i=0; i < formArray.length; ++i) {

document.writeln(formArray[i] + "<br />");

}

/* ]]> */

</script>

</body>

</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote