¸ð »çÀÌÆ® ¸ð ȸ¿øÀÌ Áú¹®Çϼż ´ëÃæ ¸¸µé¾ú´Âµ¥ È®½ÇÇÑÁö´Â Àúµµ ¸ð¸£°Ú½À´Ï´Ù.
´©¸®Áý ÁÖ¼Ò¸¦ Àû´Â ÀÎDzÆû¿¡ Á¦´ë·Î µÈ À¯¾Ë¿¤À» ³Ö¾ú´ÂÁö °Ë»çÇÏ´Â ÀÚ¹Ù½ºÅ©¸³Æ® Á¤±ÔÇ¥Çö½ÄÀÔ´Ï´Ù.
<form method=post name=write onsubmit="return check_comment_submit(this)">
<input type=text name=homepage style="height:19px;width:200px;">
<input type=submit value='Alt + S' accesskey="s">
</form>
<script language="JavaScript">
function check_comment_submit(obj) {
if(obj.homepage.value != '') {
var urlpattern = /^[http://]+[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$/;
if(!urlpattern.test(obj.homepage.value)) {
alert("Á¤»óÀûÀÎ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¿© Áֽʽÿä");
} else {
alert("À¯È¿ÇÑ ÁÖ¼ÒÀÔ´Ï´Ù.");
}
}
return true;
}
</script>
Å×½ºÆ®(ÀÌ ¸µÅ©´Â ¿µ±¸ÀûÀÌÁö ¾Ê½À´Ï´Ù.)
http://reedyfox.com/0409/041008.php