PDA

View Full Version : سوال: اشکال این کد چیست؟



javadt
شنبه 07 دی 1387, 23:04 عصر
سلام
اگر لطف کنید و بگید که اشکالش چی که جواب نمی ده ممنون می شم


<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ورود به بخش مديريت</title>
<script language="javascript">
function sendform()
(
var u = document.getElementById("tfuser").value;
var p = document.getElementById("tfpass").value;
if((u=="") || (p==""))
(
alert("نام كاربري/رمز عبور را وارد نماييد");
)
else
frmlogin.submit();
)
</script>
</head>
<body>
<form name="frmlogin" action="checkd.php" method="post">
<table width="300" border="0" align="center" cellpadding="5">
<tr>
<th width="186" scope="col"><label>
<input type="text" name="tfuser" id="tfuser" />
</label></th>
<td width="88" scope="col"><label>نام كاربري:</label>&nbsp;</td>
</tr>
<tr>
<td><label>
<div align="center">
<input type="password" name="tfpass" id="tfpass" />
</div>
</label></td>
<td><label>رمز عبور:</label>&nbsp;</td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="btnlogin" id="btnlogin" onclick="sendform()" value="ورود" />
<input type="button" name="btnexit" id="btnexit" value="خروج" />
</div></td>
<td>&nbsp;</td>
</tr>
</table>
</form>

</body>
</html>

raravaice
شنبه 07 دی 1387, 23:38 عصر
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ورود به بخش مديريت</title>
<script language="javascript">
function sendform()
{
var u = document.getElementById("tfuser").value;
var p = document.getElementById("tfpass").value;
if((u=="") || (p==""))
{
alert("نام كاربري/رمز عبور را وارد نماييد");
return false;
}
else
{
document.frmlogin.submit();
}
}
</script>
</head>
<body>
<form name="frmlogin" action="checkd.php" method="post">
<table width="300" border="0" align="center" cellpadding="5">
<tr>
<th width="186" scope="col"><label>
<input type="text" name="tfuser" id="tfuser" />
</label></th>
<td width="88" scope="col"><label>نام كاربري:</label>&nbsp;</td>
</tr>
<tr>
<td><label>
<div align="center">
<input type="password" name="tfpass" id="tfpass" />
</div>
</label></td>
<td><label>رمز عبور:</label>&nbsp;</td>
</tr>
<tr>
<td><div align="center">
<input type="button" name="btnlogin" id="btnlogin" onclick="sendform()" value="ورود" />
<input type="button" name="btnexit" id="btnexit" value="خروج" />
</div></td>
<td>&nbsp;</td>
</tr>
</table>
</form>

</body>
</html>

لطفا از عناوین مناسب برای تاپیک های خود استفاده نمایید.

موفق باشید