Hi Lee here is my page code now
This is for an editing page for database information, it just needs to
verify that the lName, lAddress1, lTown and lPhoneNo are not empty
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Inserting New Location</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language='JavaScript' type='text/javascript'>
function frmValidate (form) {
if (form.lName.value == '' || form.lAddress1.value == '' ||
form.lTown.value == '' || form.lPhone.value == '') {
alert('One or more of the required fields are empty.');
return false;
}
else {
return true;
}
}
</script>
</head>
<link href="redifinedTags.css" rel="stylesheet" type="text/css">
<body background="images/background.jpg">
<?
$No = $_POST['lNo'];
mysql_connect('localhost','','');
mysql_select_db('expense') or die('Error selecting database.');
$locQuery = "SELECT * FROM locations WHERE lNo = $No";
?>
<?
$locResult = mysql_query($locQuery);
while ($lRow = mysql_fetch_assoc($locResult))
{
extract($lRow);
?>
<h4>Editing <? echo $lName ?></h4>
<p>Use this below form to edit details about this item.</p>
<hr>
<form action="php_scripts/replace_location_script.php" method="post">
<table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%" height="30"><p>Name</p></td>
<td width="70%">
<input name="rNo" type="hidden" size="20" maxlength="30"
value="<? echo $lNo ?>">
<input name="rName" type="text" size="45" maxlength="30"
value="<? echo $lName ?>"><font size="-3" face="Verdana"
color="#000099">req.</font>
</td>
</tr>
<tr>
<td height="30"><p>Address</p></td>
<td>
<input name="rAddress1" type="text" size="45" maxlength="30"
value="<? echo $lAddress1 ?>"><font size="-3" face="Verdana"
color="#000099">req.</font>
</td>
</tr>
<tr>
<td height="30"></td>
<td>
<input name="rAddress2" type="text" size="45" maxlength="30"
value="<? echo $lAddress2 ?>">
</td>
</tr>
<tr>
<td height="30"><p>Town</p></td>
<td>
<input name="rTown" type="text" size="20" maxlength="15"
value="<? echo $lTown ?>"><font size="-3" face="Verdana"
color="#000099">req.</font>
</td><td width="1%">
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td height="30"><p>Phone</p></td>
<td>
<input name="rPhoneNo" type="text" size="20" maxlength="15"
value="<? echo $lPhoneNo ?>"><font size="-3" face="Verdana"
color="#000099">req.</font>
</td>
</tr>
</table>
<?
}
mysql_free_result($locResult);
?>
<br>
<input name="Enter" onClick="return frmValidate(this.form);"
type="submit" value="Update">
<input name="Reset" type="reset" value="Reset">
</form>
</body>
</html>
--
Shane Jones.................
shanemjo82@yahoo.co.uk <mailto:shanemjo82@yahoo.co.uk>