in my code
i enter the employee ID and the user name
both is the same and i wanna when i enter the employee id
it is display in the user name filed automatically
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body style="text-align: center">
<head>
<title>Add Employee</title>
<link rel="stylesheet" type="text/css"
href="style.css"/>
<script language="javascript">
function validation(form)
{
if ((form.id_Num.value)=="" || (form.id_Num.value).length < 4 )
{
alert("Employee ID must be 4 characters !!");
return false;
}
if ((form.Fname.value)=="" )
{
alert("Please enter Fname !!");
return false;
}
if ((form.Mname.value)=="" )
{
alert("Please enter Mname !!");
return false;
}
if ((form.Lname.value)=="" )
{
alert("Please enter Lname !!");
return false;
}
if ((form.Position.value)== 0 )
{
alert("Please enter Position !!");
return false;
}
if ((form.dev_1.value)== "" )
{
alert("Please enter the device id of employee !!");
return false;
}
if ((form.jop.value)== 0 )
{
alert("Please enter Job Title !!");
return false;
}
if ((form.username.value)=="" || (form.username.value).length < 4)
{
alert("The username must be 4 characters !!");
return false;
}
if ((form.password.value)=="" || (form.password.value).length < 6)
{
alert("Password must be 6 characters !! ");
return false;
}
return true;
}
//--></script>
</head>
<div>
<center>
<font face="Arial Narrow,Bold" size="1">
<b>
</b></font></center>
<form action='add-done.php' method='POST' >
<b>
<div align="center">
<table border='0' width='100%' height='20' div align='center' cellspacing='0'><tr><td class='bar' width='5%'><img src='user_add.png' width='80' height='48' ></td>
<td class='bar'><font size='5' face='Arial'>Add Employee</td></tr>
</table>
<p> </p>
<table border="2" width="35%" bordercolorlight="#996633" bordercolordark="#5A3A0B" bordercolor="#5A3A0B" >
<tr>
<td width="451" align="center" colspan="3">
<p align="left"><b>Employee ID:<font size="3"><input type="text" name="id_Num" size='20'/></font></td>
</tr>
<tr>
<td width="132" align="center">
<p align="left"><b>First:<font size="3"><input type="text" name="Fname" size='15'/></font></td>
<td width="132"><b>Middle:<font size="3"><input type="text" name="Mname" size='15'/></font></td>
<td align="center" width="132">
<b>Last :<font size="3"><input type="text" name="Lname" size='15'/></font></td>
</tr>
<p align="left"> </div>
</b>
<div align="center">
<table border="2" width="27%" bordercolorlight="#996633" bordercolordark="#5A3A0B" bordercolor="#5A3A0B" >
<tr>
<td width="353">
<p align="left"><b>Employee Login</b></td>
</tr>
<tr>
<td width="353">
<p align="left"><b>Username:<input type="text" name="username" size='30'/></td>
</tr>
<tr>
<td width="353">
<p align="left"><b>Password:<input type="text" name="password" size='30'/></td>
</tr>
</table>
</div>
<p align="left"> </p>
<p style="text-align: center"><b>
<font FACE="Arial Narrow,Bold" SIZE="1">
<font size="4">
<input type="submit" value="ADD" onclick="return validation(form);" name="B1" style="font-weight: bold; background-color: #996633; font-size:12pt"></font>
</font>
</form>
</b></p>
</div>
</body></html>
This post has been edited by Atli: 18 May 2012 - 04:11 PM
Reason for edit:: Titled updated. Please use the title to describe the question, not to tell us you need help. We already know that.

New Topic/Question
Reply



MultiQuote




|