<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>空置控制</title>
<style type="text/css">
td.left {
text-align: right;
}
td.right {
text-align: left;
}
hr {
width: 500px;
height: 5px;
background-color: #000;
}
</style>
<script>
function funtwo(form) {
var r=true;
var formElements=form.elements;
for(var i=0;i<formElements.length;i++){
currentElement=formElements[i];
if (currentElement.value=="" && currentElement.className=="required") {
alert("The required field \""+currentElement.name+"\" is empty.Pleasse provide a value for it.");
currentElement.focus();
r=false;
break;
}
}
return r;
}
</script>
</head>
<body>
<form name="frmtwo" action="" method="post" οnsubmit="return funtwo(this);">
<table>
<tr>
<td class="left">
<label for="name">Name:</label>
</td>
<td class="right">
<input name="name" id="name" type="text" class="required" size="12" />
</td>
</tr>
<tr>
<td class="left">
<label for="email">E-mail:</label>
</td>
<td class="right">
<input name="email" id="email" type="text" class="required" size="12" />
</td>
</tr>
<tr>
<td class="left" valign="top">
<label for="query">Pleasse enter your <br>query here:<br>(optional)</label>
</td>
<td class="right"><textarea rows="8" cols="30" name="query" id="query" class="required"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit your query" /></td>
</tr>
</table>
</form>
</body>
</html>