Apakah anda punya blog? Dan ingin membuat buku tamu pada blog anda? Pada kesempatan kali ini, Saya akan mencoba membagikan tutorial membuat buku tamu sederhana dengan html dan javascript.Buku tamu ini sangat-sangat sederhana dan sobat bisa modifikasi tuh script biar kelihatan lebih bagus lagi...
Silahkan kopi scripnya.....
<HTML><HEAD><TITLE>BUKU TAMU</TITLE><SCRIPT LANGUAGE="JavaScript">
function formCheck() {
if (document.Form.mail.value=="" && document.Form.phone.value=="") {
alert("Yakin anda akan mengirimkan buku tamu ini?.");document.Form.mail.focus();return false
}
if (document.Form.mail.value!="") {
if (document.Form.mail.value.indexOf("@")==-1 || document.Form.mail.value.indexOf(".")==-1 || document.Form.mail.value.indexOf(" ")!=-1 || document.Form.mail.value.length<6) {
alert("Sorry, your email address is not valid.");document.Form.mail.focus();return false
}}
if (document.Form.item.value=="") {
alert("What would you like to buy, sell, or trade?");document.Form.item.focus();return false
}
if (document.Form.description.value.indexOf("://")!=-1) {
alert("The string :// is not allowed in the Description field.");document.Form.description.focus();return false
}}
function showValue() {
if (document.Form.transaction.options[document.Form.transaction.selectedIndex].value=="1") {
document.Form.price.value = "US $"
}
if (document.Form.transaction.options[document.Form.transaction.selectedIndex].value=="2") {
document.Form.price.value = "Up to $"
}
if (document.Form.transaction.options[document.Form.transaction.selectedIndex].value=="3") {
document.Form.price.value = ""
}
if (document.Form.transaction.options[document.Form.transaction.selectedIndex].value=="0") {
document.Form.price.value = ""
}}
// End cloak-->
</SCRIPT></HEAD><B>BUKU TAMU </B>Silahkan Isi data anda!!!<UL><LI>Tidak Diizinkan Spam.
<LI> Jangan Menekan tombol submit berulang-ulang
<HR WIDTH="75%"><FORM NAME="Form" METHOD=POST ACTION="" onSubmit="return formCheck()"><CENTER>
<TABLE>
<TR>
<TD ALIGN=RIGHT VALIGN=TOP><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>Name:</FONT></TD>
<TD><INPUT NAME="name" SIZE=30 MAXLENGTH=34></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=TOP><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>Email:</FONT></TD>
<TD><INPUT NAME="mail" SIZE=30 MAXLENGTH=34></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=TOP><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>Phone:</FONT></TD>
<TD><INPUT NAME="phone" SIZE=30 MAXLENGTH=34></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=TOP><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>Location:</FONT></TD>
<TD><INPUT NAME="location" SIZE=30 MAXLENGTH=34></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=TOPFONT FACE="Verdana,Arial,Helvetica" SIZE=-1>JK:</FONT></TD>
<TD><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>
<INPUT TYPE=RADIO NAME="jenis_kelamin" VALUE="1">Cowok <INPUT TYPE=RADIO NAME="price_type" VALUE="2">Cewek <SPACER SIZE=15>
</FONT></TD>
</TR>
<TR>
<TD VALIGN=TOP><FONT FACE="Verdana,Arial,Helvetica" SIZE=-1>Description:<SPACER SIZE=2></FONT></TD>
<TD><TEXTAREA NAME="description" WRAP=VIRTUAL ROWS=8 COLS=48>
</TEXTAREA></TD>
</TR>
</TABLE><P>
<INPUT TYPE=SUBMIT VALUE="Submit"><SPACER TYPE=BLOCK WIDTH=6>
<INPUT TYPE=RESET></CENTER></FORM><HR NOSHADE><I>Qodia <<A HREF="mailto:skyblue@bayside.net">qodia@qodia.net</A>></I>
</FONT>
</BODY>
</HTML>
Semoga Bermanfaat.......!
Artikel keren lainnya:
hasil input buku tamu gak bisa tampil
ReplyDelete