i have written a script with the help of Java 24 hr trainer but now need to add some other function and cant figure out how to go about it.
Im am validating form fields and then would like to return the fields in a prompt box after validation is complete and as a final display on screen and also to get user to confirm details are correct before final submit is activated.
how do i go about this correctly? i think i need to set up another function that gets a string of varibles that have been input by user and prompt them.
i know the code is unruly but its my first attempt.

i presume this is incredibly basic for you people .any help greatly appreciated.
code is as follows
javascript Code:
function validateForm(event) { //assign function id
var form1 = document.form1; //assign varibles
var first = form1.first;
var last = form1.last;
var age = form1.age;
var email = form1.email;
var state = form1.state;
var button = form1.btnSubmit;
var textAge = parseInt(age.value);
// validate first name field
if (!isEmpty(first.value)) {
// valiidate last name field
if (!isEmpty(last.value)) {
// validate email field
if (email.value.indexOf("@") > 0 ) {
//validate age field
if (!isNaN(textAge) && textAge >=18) {
//alert messages when conditions are true
} else {
alert("Please enter your age, you must be over 18");
age.focus();
age.select();
}
} else {
alert("Please enter a valid email address");
email.focus();
email.select();
}
} else {
alert("Please enter your last name");
last.focus();
last.select();
}
} else {
alert("Please enter your first name");
first.focus();
first.select();
}
}
//to determine if a value is empty
function isEmpty(value) {
return (value === "");
}