I am attempting to create a form. It was working but somewhere along the way everything went blank
The only thing I changed between the time it was working, and no longer working was the submit button. But all I did was move it to the bottom of the page. I tried moving it back (to the center of the page) but that no longer works either.
I don’t see anything wrong.
[code]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” />
<title>Billing Information Name Addr</title>
<script type=”text/javascript” src=”test.js”></script>
</head>
<body>
<div class=”billing”>
<form action=”” method=”get” onsubmit=”” name=”form1″>
Billing Information<br />
<br />
Name<br />
<input id =”bname” name=”bname” size=”40″ type=”text” tabindex=”1″ /><br />
<br />
Address<br />
<input id =”baddress” name=”baddress” size=”40″ type=”text” tabindex=”3″ /><br />
<br />
City, State, Zip<br />
<input name=”city” size=”30″ type=”text” tabindex=”4″ /><input name=”state” size=”10″ type=”text” tabindex=”5″ /><input name=”zip” size=”15″ type=”text” tabindex=”6″ /><br />
</form>
</div>
<br />
<div class =”shipping” >
<form action=”” method=”get” onsubmit=”” name=”form2″>
Shipping Information<br />
<br />
Name<br />
<input name=”sname” size=”40″ type=”text” tabindex=”7″ /><br />
<br />
Address<br />
<input name=”saddress” size=”40″ type=”text” tabindex=”8″ /><br />
<br />
City, State, Zip<br />
<input name=”scity” size=”30″ type=”text” tabindex=”9″ /><input name=”sstate” size=”10″ type=”text” tabindex=”10″ /><input name=”szip” size=”15″ type=”text” tabindex=”11″ /><br />
<br />
</form>
</div>
<div class=”telephone” >
<form action=”” method=”get” onsubmit=”” name=”form3″>
<p>Telephone:</p>
<input name=”tele1″ size=”6″ type=”text” />
<input name=”tele2″ size=”4″ type=”text” />
<input name=”tele3″ size=”7″ type=”text” />
</form>
<div class=”submit”>
<form action=”” method=”get” onsubmit=”return confirmSubmit();” name=”form1″>
<p>Submit</p>
<input type=”submit” value=”submit” />
</form>
<div>
</body>
</html>
Just to confirm, the javascript
[code]
function confirmSubmit() {
var bname = document.form1.bname.value;
var baddress = document.form1.baddress.value;
var city = document.form1.city.value;
var zip = document.form1.zip.value;
var state = document.form1.state.value;
var tele1 = document.form3.tele1.value;
var tele2 = document.form3.tele2.value;
var tele3 = document.form3.tele3.value;
var submit = document.form1.submit.value;
if (bname.length === 0) {
alert(“You Must Enter your Billing Information Name”);
return false;
}
if (baddress.length === 0) {
alert(“You Must Enter your Address”);
return false;
}
if (city.length === 0) {
alert(“You Must Enter your City”);
return false;
}
if (zip.length === 0) {
alert(“You Must Enter your Zip Code”);
return false;
}
if (state.length === 0) {
alert(“You Must Enter your State”);
return false;
}
if (tele1.length === 0) {
alert(“You Must Enter your Telephone”);
return false;
}
if (tele2.length === 0) {
alert(“You Must Enter your Telephone”);
return false;
}
if (tele3.length === 0) {
alert(“You Must Enter your Telephone”);
return false;
}
else {
return true;
}
}