Monthly Archives: May 2008

Form validation

Ngày trước tôi chỉ cần check cái input form (hữu hạn) để nó khác rỗng. Ngày nay tôi phải: Check cả kiểu dữ liệu Check cả format (số điện thoại, số thẻ tín dụng…) Check các field mà không biết … Continue reading

Posted in Trick | Leave a comment

How to select the first option in a combo box?

Simply in jQuery (a Javascript framework – Write less, do more): ?View Code JAVASCRIPT1 $("#div_id option:first).attr("selected","selected");  Example:  ?View Code JAVASCRIPT1 2 3 4 5 6 7 8 $(’#myCombo’).load( ‘my_combo.php?foo=bar’, function() { $(’#myCombo option:first).attr("selected","selected"); } ); html: <select id="myCombo"></select>

Posted in jQuery | 2 Comments

Installed Simple Captcha system

Installed Simple Captcha system to hinder spammer

Posted in Upgrade | Leave a comment

DirectoryIndex vs RewriteEngine

Tôi dùng modRewrite cho site hanhnguyenhotel.com. Mọi chuyện đều ổn nếu như thằng Kid không yêu cầu có cái trang intro (index.html). Mặc dù tôi đã để default file là index.html nhưng vẫn không ăn thua: ?View Code PHP1 2 … Continue reading

Posted in Apache | 2 Comments