<html>
<head>
<title>Confirm</title>
</head>
<body>
<h2 align="center">User Registration Confirmation page.</h2>
<form name="registration" method="post" action="output.php" enctype="multipart/form-data">
<table width="400" border="1" align="center" cellpadding="5" cellspacing="0" bgcolor="#EEEEFF">
<tr>
<td width="47%" align="left"> <B> Full Name </B> </td>
<td width="50%" align="left">
<?php
//--- Validating the full name Input value.
if(empty($_POST['full']))
{
echo(" No name submitted");
}
//--- Validating whether the length of the full name Input value Is between 5 to 50 characters.
elseif ( (strlen($_POST['full']) < 5) || (strlen($_POST['full']) > 50))
{
echo("Invalid name");
}
else
{
//--- Printing the full name Input value.
echo $_POST['full'];
}
?>
</td>
</tr>
<tr>
<td width="47%" align="left"> <B> User Name </B> </td>
<td >
<?php
//--- Validating the user name Input value.
if(empty($_POST['user']))
{
echo(" No user name submitted");
}
//--- Validating whether the length of the user name Input value Is between 5 to 50 characters.
elseif ( (strlen($_POST['user']) < 5) || (strlen($_POST['user']) > 50))
{
echo("Invalid user name");
}
else
{
//--- Printing the user name Input value.
echo $_POST['user'];
}
?>
</td>
</tr>
<td height="2" colspan="2">
<table width="100%" border="0">
<tr>
<td>
<?php
echo "<input type=hidden name=\"full\" value=\"".$full."\" >\n"
echo "<input type=hidden name=\"user\" value=\"".$user."\" >\n";
?>
<input type="submit" name="Submit" value="Confirm >>" align="right">
<a href="javascript:history.back()" onclick="history.back();return false"><input type="submit" name="Back" value="<< Back" align="left"></a>
</form>
</td>
</tr>
</table>
</form>
</body>
</html>
How do i disable my Confirm button if important fields such as User Name are not fill in properly/left empty , as clicking on the Confirm button would lead to the database page.
PS This is only portion of the code as the full code would exceed the text limit