E:test.html                                                     Sunday, August 23, 2009 11:10 PM

Noi dung file c:test.css...
E:test.html                                                                Sunday, August 23, 2009 11:10 PM

             ...
E:test.html                                                                Sunday, August 23, 2009 11:10 PM

             ...
E:test.html         Sunday, August 23, 2009 11:10 PM

</HTML>




               -4-
Upcoming SlideShare
Loading in …5
×

Test

1,002 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Test

  1. 1. E:test.html Sunday, August 23, 2009 11:10 PM Noi dung file c:test.css: body { text-align: center; } div.formContent { margin: 0 auto; text-align: left; width: 400px; } div.textElement { float: left; text-align: right; width: 100px; } div.inputElement { float: left; width: 298px; } Noi dung file c:test.html: <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="test.css" /> <script> function kiemTraRong(tenDieuKhien, giaTri) { if (giaTri == "") { alert(tenDieuKhien + " phai co gia tri"); } } function kiemTraForm() { var hoaCanh = document.getElementById("hoaCanh"); if (hoaCanh.ten.value == "") { return ; } if (hoaCanh.diaChi.value == "") { return ; } if (hoaCanh.dienThoai.value == "") { return ; } if (hoaCanh.email.value == "") { return ; } if (hoaCanh.soLuong.value == "") { return ; } -1-
  2. 2. E:test.html Sunday, August 23, 2009 11:10 PM if (hoaCanh.yeuCau.innerHTML == "") { return ; } hoaCanh.submit(); } </script> </HEAD> <BODY> <div class="formContent"> <form action="http://google.com" id="hoaCanh" > <div class="formElement"> <div class="textElement"> Ho ten: </div> <div class="inputElement"> <input type="text" name="ten" value="" onblur="kiemTraRong('Ho ten', this.value);" /><span>*</span> </div> <div class="clear" ></div> </div> <div class="formElement"> <div class="textElement"> Dia chi: </div> <div class="inputElement"> <input type="text" name="diaChi" value="" onblur="kiemTraRong('Dia chi', this.value);" /><span>*</span> </div> <div class="clear" ></div> </div> <div class="formElement"> <div class="textElement"> Dien thoai: </div> <div class="inputElement"> <input type="text" name="dienThoai" value="" onblur="kiemTraRong('Dien thoai', this.value);" /><span>*</span> </div> </div> <div class="formElement"> <div class="textElement"> Email: </div> <div class="inputElement"> <input type="text" name="email" value="" onblur="kiemTraRong('Email', this.value);" /><span>*</span> </div> </div> <div class="formElement"> <div class="textElement"> Loai hoa: </div> <div class="inputElement"> <select name="loaiHoa"> <option value="thuocduoc">Hoa thuoc duoc</option> <option value="hoahong">Hoa hong</option> -2-
  3. 3. E:test.html Sunday, August 23, 2009 11:10 PM </select> Mau: <select name="mau"> <option value="do">Do</option> <option value="hong">Hong</option> </select> </div> </div> <div class="formElement"> <div class="textElement"> So luong: </div> <div class="inputElement"> <input type="text" name="soLuong" value="" onblur="kiemTraRong('So luong', this.value);" /><span>*</span> </div> </div> <div class="formElement"> <div class="textElement"> Don vi tinh: </div> <div class="inputElement"> <input type="radio" name="donVi" value="nhanh" />Nhanh <input type="radio" name="donVi" value="bo" />Bo <input type="radio" name="donVi" value="chau" />Chau </div> </div> <div class="formElement"> <div class="textElement"> Thanh toan: </div> <div class="inputElement"> <input type="radio" name="thanhToan" value="tienMat" />Tien mat <input type="radio" name="thanhToan" value="chuyenKhoan" />Chuyen khoan <input type="radio" name="thanhToan" value="sec" />Sec </div> </div> <div class="formElement"> <div class="textElement"> Yeu cau </div> <div class="inputElement"> <textarea name="yeuCau" onblur="kiemTraRong('Yeu cau', this.innerHTML);" > </textarea> </div> </div> <div class="formElement"> <div class="textElement"> </div> <div class="inputElement"> <input type="button" value="Dang ky" onclick="kiemTraForm();" /> <input type="reset" value="Xoa thong tin" /> </div> </div> </form> </div> </BODY> -3-
  4. 4. E:test.html Sunday, August 23, 2009 11:10 PM </HTML> -4-

×