Question: **please add alert and form validation** make sure all the buttons work body{ background-color:#F8F8FF; } Join Us Fitness Power For a healthy living Home target=_top>
**please add alert and form validation**
make sure all the buttons work
body{
background-color:#F8F8FF;
}
"Fitness Power"
For a healthy living
Hometarget="_top">DrinksColor=black>Join Us} #txtState,#txtZip{ width: 25px;;}Join Us
Step 1:Enter vour name, address, and phone number :
Name: Address: City: State :Zip:Phone: Email: Step 2:Select the membership you want:
"Weekly""Monthly""Yearly""Quartly"Select the type of exercise you want:
CardiowalkingAerobicYogaLiftingCyclingPilatesTrainerfunction doSubmit(){var customer = document.Form.customer.value;if (customer.length == 0){alert("Please enter a customer name.");return;}/* continue the rest of text boxes */if (validateRadio() == false){alert("Please select a membership.");return;}alert("Your form has been submitted.");return;}function validateRadio(){if (document.Form.sizes[0].checked) return true;if (document.Form.sizes[1].checked) return true;if (document.Form.sizes[2].checked) return true;if (document.Form.sizes[3].checked) return true;return false;}//function to select elements by idfunction $(id) {return document.getElementByld(id); }//function to display orderfunction displayOrder()var name=$("txtName").value;//getting namevar address=$("txtAddress").value;//getting advar city=$("txtCity").value;//getting cityvar state=$('txtState").value;//getting Statevar state=$('txtZip").value;//getting zipvar phone=$("txtPhone"').value;//getting phonevar email=$("txtEmail").value;//getting email//getting membershipvar membership=document.getElementsbyName(//declaring variable to membershipvar members;//using for loopfor(var i=0;i //checking which membership is selectedif(membership[i].checked==true) {//if membership is selected thenmembers=membership[i].value+""; }}//getting exercise selected by uservar exercise=document.getElements by Name//declaring variable to exercisevar exercise=" ";//using for loopfor(var i=0;iHome Drinks Join Us Join Us Step 1:Enter your name, address, and phone number: Name: Address: City: Phone: Email: State: Zip: Step 2:Select the membership you want: "Weekly" "Monthly" "Yearly" "Quartly" Select the type of exercise you want: Cardio o walking Aerobic Yoga Lifting Cycling Pilates Trainer Submit Order Clear Entries {//checking which membership is selectedif(membership[i].checked==true){//if exercise is selected thenexercise+=exercise[i].value+", ";} }var htmlString="";//declaring variable to storehtmlString+="Name : " +name+"Address: "+address+"
;htmlString+="City: " +city+"State: "+state+"
;htmlString+="Email: " +email+"membership: "+members+"
;htmlString+="exercise: " +exercise+"
";//display details on the div("exercise").innerHTML=htmlString; }![]()
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
