You are on page 1of 3

<html>

<head>
<title> tuan dat @_@ </title>
<script>
function start()
{
frmnhap.masosinhvien.focus()
frmnhat.nh.disabled=true
}
function test()
var masosinhvien,hoten,ngaysinh,hinh;
masosinhvien=frmnhap.mssv.value;
hoten=frmnhap.ht.value;
ngaysinh=frmnhap.ns.value;
hinh=frmnhap.h.value;
if(masosinhvien="");
{
alert(" Ban quen nhap MA SO SINH VIEN roi !")
return;
}
if(hoten="")
{
alert("Ban quen nhap HO TEN roi !")
return;
}
if(ngaysinh="")
{
alert("Ban quen nhap NGAY SINH roi !")
return;
}
if(hinh="")
{
alert("Ban quen nhap HINH roi !"
return;
}
frmnhap.nh.disabled=false
}
var count;
count=1;
function writedata()
{
var masosinhvien,hoten,ngaysinh,hinh;
var phandau,phanthan,phanthem,phancuoi
masosinhvien=frmnhap.mssv.value;
hoten=frmnhap.ht.value;
ngaysinh=frmnhap.ns.value;
hinh=frmnhap.h.value;
Idmasosinhvien.innerHTML=masinhvien
Idhoten.innerHTML=hoten
Idngaysinh.innerHTML=ngaysinh
Idhinh.innerHTML=hinh
Idmasosinhvien.id="Idmasosinhvien"+count
Idhoten.id="Idhoten"+count
Idngaysinh.id="Idngaysinh"+count
Idhinh.id="IDhinh"+count
count++;
phanthan=Iddata.innerHTML
phandau="<table id=Iddata border=1 cellpadding=1 cellspacing=1
width=100% style='border-collapse:collapse'>"
phanthem="<tr>"
phanthem+="<td width=50% id=Idmasosinhvien style='font-
family:tahoma;font-size:10pt;color:#336699;font-
weidth:bold'>&nbns;</td>"
phanthem+="<td width=50% id=Idhoten style='font-family:tahoma;font-
size:10pt;color:#336699;font-weidth:bold'>&nbns;</td>"
phanthem+="<td width=50% id=Idngaysinh style='font-family:tahoma;font-
size:10pt;color:#336699;font-weidth:bold'>&nbns;</td>"
phanthem+="<td width=50% id=Idhinh style='font-family:tahoma;font-
size:10pt;color:#336699;font-weidth:bold'>&nbns;</td>"
phanthem+="</tr>"
phancuoi="</table>"
Iddata.outerHTML=phandau+phanthan+phanthem+phancuoi
frmnhap.nh.disabled=true
frmnhap.mssv.value=""
frmnhap.ht.value=""
frmnhap.ns.value=""
frmnhap.h.value=""
}
</script>
</head>
<body onLoad=start()>
<form method="post" action=" -- tuandat ct7 ^_^ --" name="frmnhap">
<table width=100% border=1 cellspacing=1 cellpadding=1 style="border-
collapse:collapse">
<tr>
<td width=100% colspan=2 style="font-family::times new roman;font-
size=14pt;color:#808000;font-weidth:bold" align="center"
bgcolor="#e6fff9">THEM SINH VIEN</td>
</tr>
<tr>
<td width="26%" style="font-family:times new roman;font-
size=14pt;color:#808000;font-weidth:bold" align="center"
bgcolor="#e6fff9">Ma So Sinh Vien</td>

<td width="26%" style="font-family:times new roman;font-


size=14pt;color:#808000;font-weidth:bold"><input type="text" name="mssv"
size="20"></td>
</tr>
<tr>
<td width="26%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold" align="right">Ho va ten</td>

<td width="74%" style="font-family: Tahoma; font-size: 10pt; color:


#336699; font-weight: bold"><input type="text" name="ht" size="20"
onBlur="Test()"></td>
</tr>
<tr>
<td width="26%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold" align="right">Ngay Sinh</td>
<td width="74%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold"><input type="text" name="ns" size="20"
onBlur="Test()"></td>
</tr>
<tr>
<td width="26%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold" align="right">Hinh</td>
<td width="74%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold"><input type="file" name="h" size="20"
onBlur="Test()"></td>
</tr>
<tr>
<td width="26%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold" align="right"></td>
<td width="74%" style="font-family: Tahoma; font-size: 10pt; color:
#336699; font-weight: bold"><input type="button" value="Nhap"
onClick="writedata()" name="nh"></td>
</tr>
<tr>
<td width="100%" style="font-family: Times New Roman; font-size: 14pt;
color: #CC3300; font-weight: bold" align="center" colspan="2"
bgcolor="#E6FFF9">DANH
SACH SINH VIEN</td>
</tr>
<tr>

Giải dùm mình bài toán này nhé ( dung html và


javascript)

Khi ta nhập các thông tin vào các input type , nhấn add sẽ xuất ra DANH SÁCH SINH
VIÊN (dùng tag talble nhé). Ubdate để cập nhật thêm

You might also like