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

I was wondering what I can do to display a message if I forget to enter my credi

ID: 3718439 • Letter: I

Question

I was wondering what I can do to display a message if I forget to enter my creditcard, cvv and expiration date and press submit. PLEASE HIGHLIGHT OR BOLD THE CODE THAT YOU CREATED SO IT IS EASIER FOR ME TO SEE. I can go back to my code and add the new code instead of typing it again.

<!DOCTYPE html>

<html>

<head>

<!--

Final Project - Gym Website

Professor Archibald

New York City College of Technology

Application Form

Author: Sujoy Sarkar

Date: April 25, 2018

Filename: application.html

-->

<body text=""></body>

<p>

<img src="i.png" alt="Logo" width="800" height="400" />

<br/>

<a href="index.html"> About Us </a> &nbsp;&nbsp;&nbsp;

<a href="application.html"> Application Form </a> &nbsp;&nbsp;&nbsp;

<a href="direction.html"> Direction </a> &nbsp;&nbsp;&nbsp;

<title>Gym Application</title>

<script>

function doClear()

{

document.Application.fname.value = "";

document.Application.lname.value = "";

document.Application.address.value = "";

document.Application.city.value = "";

document.Application.state.value = "";

document.Application.zip.value = "";

document.Application.phone.value = "";

document.Application.email.value = "";

document.Application.gender[0].checked = false;

document.Application.gender[1].checked = false;

document.Application.membershipPeriod[0].checked = false;

document.Application.membershipPeriod[1].checked = false;

document.Application.membershipPeriod[2].checked = false;

document.Application.membershipPeriod[3].checked = false;

document.Application.name.value = "";

document.Application.pass.value = "";

document.Application.confirmpass.value = "";

return;

}

function doSubmit()

{

if (validateText() == false)

{

return;

}

if (validation() == false)

{

return;

}

if (validateForm() == false)

{

alert("Please choose your gender: Male or Female");

return;

}

if (validateRadio() == false)

{

alert("Please choose your membership type.");

return;

}

if (validateAccount() == false)

{

alert("Please create an account to complete your application.");

return;

}

alert("Thank You for becoming a member of Sarkar's Elite Fitness. You will get your membership card within 4-5 business days. You also need to check your email to verify the email address associated with your account. If you have any questions, comments or concerns, please feel free to contact us.");

return;

}

function validateText()

{

var customer = document.Application.fname.value;

if (customer.length == 0)

{

alert("Please enter your first name.");

return false;

}

var customer = document.Application.lname.value;

if (customer.length == 0)

{

alert("Please enter your last name.");

return false;

}

var address = document.Application.address.value;

if (address.length == 0)

{

alert("Please enter your address.");

return false;

}

var city = document.Application.city.value;

if (city.length == 0)

{

alert("Please enter your city name.");

return false;

}

var state = document.Application.state.value;

if (state.length == 0)

{

alert("Please enter your state.");

return false;

}

var zip = document.Application.zip.value;

if (zip.length == 0)

{

alert("Please enter your zip code.");

return false;

}

if (!validation())

return false;

var email = document.Application.email.value;

if (email.length == 0)

{

alert("Please enter your email.");

return false;

}

return true;

}

function validateForm()

{

if ((document.getElementById("m").checked == false) && (document.getElementById("f").checked == false))

{

return false;

}

return true;

}

function validation()

{

var phone = document.getElementsByName('phone');

if (phone[0].value == "")

{

alert("Please enter the phone number:");

phone[0].focus();

return false;

}

return true;

}

function validateRadio()

{

var getMembershipPeriod = document.getElementsByName("membershipPeriod");

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

{

if (getMembershipPeriod[i].checked)

{

return true;

}

}

return false;

}

function validateAccount()

{

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

var password = document.getElementById("pass").value;

var cPassword = document.getElementById("confirmpass").value;

if (username == '')

{

alert("Please enter your username");

return false;

}

else if (username.length < 6)

{

alert("Username can't be less than 6.");

return false;

}

if (password == '')

{

alert("Please enter your password");

return false;

}

else if (password.length < 6)

{

alert("Password can't be less than 6.");

return false;

}

if (cPassword == '')

{

alert("Please re-enter your password");

return false;

}

else if (cPassword.length < 6)

{

alert("Password can't be less than 6.");

return false;

}

else if (password != cPassword)

{

alert("Confirm Password didn't match.");

return false;

}

return true;

}

</script>

</head>

<body>

<form name="Application"> <font face="Courier New">

<b><center> <h1>Your Information</h1> </center></b>

<p>

<u><h4>Details:</h4> </u>

First Name: &nbsp;&nbsp;&nbsp; <input name="fname" size="50" type="text">

<br>

Last Name: &nbsp;&nbsp;&nbsp;&nbsp; <input name="lname" size="50" type="text">

<br>

Address: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="address" size="50" type="text">

<br>

City: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="city" size="50" type="text">

<br>

State: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="state" size="50" type="TEXT">

<br>

Zip: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="zip" size="5" type="text">

<br>

Phone: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="phone" size="50" type="text">

<br>

Email: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="email" size="50" type="text">

<br>

</font>

</p>

Your Gender:

<br>

<input type="radio" name="gender" value="male" id="m">Male

<input type="radio" name="gender" value="Female" id="f">Female

<br>

<p>

<u><h4>Membership:</h4></u>

<input name="membershipPeriod" type="radio"> 3 Months - $30.00

<br>

<input name="membershipPeriod" type="radio"> 6 Months - $60.00

<br>

<input name="membershipPeriod" type="radio"> 9 Months - $90.00

<br>

<input name="membershipPeriod" type="radio"> Yearly - $120.00

<br>

</font>

</p>

<p>

<table>

<body>

<tr>

<td>Card Number: &nbsp;&nbsp;&nbsp;</td>

<td><input name="cardNumber" size="50" type="text"></td>

</tr>

<tr>

<td> CVV: &nbsp;&nbsp;&nbsp;&nbsp;</td>

<td> <input name="cvv" size="50" type="text"> </td>

</tr>

<tr>

<td> Expiration Date: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td>

<select>

<option value="01">January</option>

<option value="02">February </option>

<option value="03">March</option>

<option value="04">April</option>

<option value="05">May</option>

<option value="06">June</option>

<option value="07">July</option>

<option value="08">August</option>

<option value="09">September</option>

<option value="10">October</option>

<option value="11">November</option>

<option value="12">December</option>

</select>/

<select>

<option value="16"> 2016</option>

<option value="17"> 2017</option>

<option value="18"> 2018</option>

<option value="19"> 2019</option>

<option value="20"> 2020</option>

<option value="21"> 2021</option>

</select>

</td>

</tr>

</body>

</table>

</p>

<p>

<font face="Courier New">

<u><h4>Create a Account:</h4></u>

<tr>

<td>Create Username:</td>

<td><input type="text" id="username" name="name" pattern=".{8,12}" required="required"></td>

</tr>

<br>

<tr>

<td> Password: </td>

<td><input type="password" id="pass" name="pass" pattern=".{8,12}" required="required"></td>

</tr>

<br>

<tr>

<td> Confirm Password: </td>

<td><input type="password" id="confirmpass" name="confirmpass" pattern=".{8,12}" required="required"> </td>

</tr>

</p>

<input type="button" value="Submit Order">

<input type="reset" value="Clear Entries">

<hr />

<address>

<font size="6" font color:white>

<b>Sarkar's Elite Fitness</b>

<br>

46-01 Skillman Ave.

<br>

Sunnyside, NY 11104

<br>

1 (347) 667-1848 </font>

<p>

<a href="#top">Top of the Page</a>

</p>

</body>

</html>

Explanation / Answer

<!DOCTYPE html>

<html>

<head>

<!--

Final Project - Gym Website

Professor Archibald

New York City College of Technology

Application Form

Author: Sujoy Sarkar

Date: April 25, 2018

Filename: application.html

-->

<body text=""></body>

<p>

<img src="i.png" alt="Logo" width="800" height="400" />

<br/>

<a href="index.html"> About Us </a> &nbsp;&nbsp;&nbsp;

<a href="application.html"> Application Form </a> &nbsp;&nbsp;&nbsp;

<a href="direction.html"> Direction </a> &nbsp;&nbsp;&nbsp;

<title>Gym Application</title>

<script>

function doClear()

{

document.Application.fname.value = "";

document.Application.lname.value = "";

document.Application.address.value = "";

document.Application.city.value = "";

document.Application.state.value = "";

document.Application.zip.value = "";

document.Application.phone.value = "";

document.Application.email.value = "";

document.Application.gender[0].checked = false;

document.Application.gender[1].checked = false;

document.Application.membershipPeriod[0].checked = false;

document.Application.membershipPeriod[1].checked = false;

document.Application.membershipPeriod[2].checked = false;

document.Application.membershipPeriod[3].checked = false;

document.Application.name.value = "";

document.Application.pass.value = "";

document.Application.confirmpass.value = "";

return;

}

function doSubmit()

{

  

if (validateText() == false)

{

return;

}

if (validation() == false)

{

return;

}

if (validateForm() == false)

{

alert("Please choose your gender: Male or Female");

return;

}

if (validateRadio() == false)

{

alert("Please choose your membership type.");

return;

}

if (validateCard() == false)

{

return;

}

if (validateAccount() == false)

{

alert("Please create an account to complete your application.");

return;

}

alert("Thank You for becoming a member of Sarkar's Elite Fitness. You will get your membership card within 4-5 business days. You also need to check your email to verify the email address associated with your account. If you have any questions, comments or concerns, please feel free to contact us.");

return;

}

function validateText()

{

var customer = document.Application.fname.value;

if (customer.length == 0)

{

alert("Please enter your first name.");

return false;

}

var customer = document.Application.lname.value;

if (customer.length == 0)

{

alert("Please enter your last name.");

return false;

}

var address = document.Application.address.value;

if (address.length == 0)

{

alert("Please enter your address.");

return false;

}

var city = document.Application.city.value;

if (city.length == 0)

{

alert("Please enter your city name.");

return false;

}

var state = document.Application.state.value;

if (state.length == 0)

{

alert("Please enter your state.");

return false;

}

var zip = document.Application.zip.value;

if (zip.length == 0)

{

alert("Please enter your zip code.");

return false;

}

if (!validation())

return false;

var email = document.Application.email.value;

if (email.length == 0)

{

alert("Please enter your email.");

return false;

}

return true;

}

function validateForm()

{

if ((document.getElementById("m").checked == false) && (document.getElementById("f").checked == false))

{

return false;

}

return true;

}

function validation()

{

var phone = document.getElementsByName('phone');

if (phone[0].value == "")

{

alert("Please enter the phone number:");

phone[0].focus();

return false;

}

return true;

}

function validateRadio()

{

var getMembershipPeriod = document.getElementsByName("membershipPeriod");

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

{

if (getMembershipPeriod[i].checked)

{

return true;

}

}

return false;

}

function validateCard()

{

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

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

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

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

if (cardNumber == '')

{

alert("Please enter your cardNumber");

return false;

}

else if (cvv == '')

{

alert("Please enter your cvv");

return false;

}

else if (date1 == '')

{

alert("Please Select Month");

return false;

}

else if (date2 == '')

{

alert("Please Select Year");

return false;

}

else

{

return true;

}

  

  

}

  

  

function validateAccount()

{

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

var password = document.getElementById("pass").value;

var cPassword = document.getElementById("confirmpass").value;

if (username == '')

{

alert("Please enter your username");

return false;

}

else if (username.length < 6)

{

alert("Username can't be less than 6.");

return false;

}

if (password == '')

{

alert("Please enter your password");

return false;

}

else if (password.length < 6)

{

alert("Password can't be less than 6.");

return false;

}

if (cPassword == '')

{

alert("Please re-enter your password");

return false;

}

else if (cPassword.length < 6)

{

alert("Password can't be less than 6.");

return false;

}

else if (password != cPassword)

{

alert("Confirm Password didn't match.");

return false;

}

return true;

}

</script>

</head>

<body>

<form name="Application"> <font face="Courier New">

<b><center> <h1>Your Information</h1> </center></b>

<p>

<u><h4>Details:</h4> </u>

First Name: &nbsp;&nbsp;&nbsp; <input name="fname" size="50" type="text">

<br>

Last Name: &nbsp;&nbsp;&nbsp;&nbsp; <input name="lname" size="50" type="text">

<br>

Address: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="address" size="50" type="text">

<br>

City: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="city" size="50" type="text">

<br>

State: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="state" size="50" type="TEXT">

<br>

Zip: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="zip" size="5" type="text">

<br>

Phone: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="phone" size="50" type="text">

<br>

Email: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="email" size="50" type="text">

<br>

</font>

</p>

Your Gender:

<br>

<input type="radio" name="gender" value="male" id="m">Male

<input type="radio" name="gender" value="Female" id="f">Female

<br>

<p>

<u><h4>Membership:</h4></u>

<input name="membershipPeriod" type="radio"> 3 Months - $30.00

<br>

<input name="membershipPeriod" type="radio"> 6 Months - $60.00

<br>

<input name="membershipPeriod" type="radio"> 9 Months - $90.00

<br>

<input name="membershipPeriod" type="radio"> Yearly - $120.00

<br>

</font>

</p>

<p>

<table>

<body>

<tr>

<td>Card Number: &nbsp;&nbsp;&nbsp;</td>

<td><input name="cardNumber" id="cardNumber" size="50" type="text"></td>

</tr>

<tr>

<td> CVV: &nbsp;&nbsp;&nbsp;&nbsp;</td>

<td> <input name="cvv" id="cvv" size="50" type="text"> </td>

</tr>

<tr>

<td> Expiration Date: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td>

<select name="date1" id="date1">

<option value="">Select Month</option>

<option value="01">January</option>

<option value="02">February </option>

<option value="03">March</option>

<option value="04">April</option>

<option value="05">May</option>

<option value="06">June</option>

<option value="07">July</option>

<option value="08">August</option>

<option value="09">September</option>

<option value="10">October</option>

<option value="11">November</option>

<option value="12">December</option>

</select>

<select name="date2" id="date2">

<option value=""> Select Year</option>

<option value="16"> 2016</option>

<option value="17"> 2017</option>

<option value="18"> 2018</option>

<option value="19"> 2019</option>

<option value="20"> 2020</option>

<option value="21"> 2021</option>

</select>

</td>

</tr>

</body>

</table>

</p>

<p>

<font face="Courier New">

<u><h4>Create a Account:</h4></u>

<tr>

<td>Create Username:</td>

<td><input type="text" id="username" name="name" pattern=".{8,12}" required="required"></td>

</tr>

<br>

<tr>

<td> Password: </td>

<td><input type="password" id="pass" name="pass" pattern=".{8,12}" required="required"></td>

</tr>

<br>

<tr>

<td> Confirm Password: </td>

<td><input type="password" id="confirmpass" name="confirmpass" pattern=".{8,12}" required="required"> </td>

</tr>

</p>

<input type="button" value="Submit Order">

<input type="reset" value="Clear Entries">

<hr />

<address>

<font size="6" font color:white>

<b>Sarkar's Elite Fitness</b>

<br>

46-01 Skillman Ave.

<br>

Sunnyside, NY 11104

<br>

1 (347) 667-1848 </font>

<p>

<a href="#top">Top of the Page</a>

</p>

</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