ho un guestbook come da allegato, ho inserito come potete notare il bottone "URL". Solo che non capisco cosa cambiare del codice per poter dare la possibilità di chi scrive di linkare.
ecco il codice della pagina in questione
codice:<script language="JavaScript"> <!-- //funzione per aggiungere i tag grassetto, sottolineato e corsivo <% If strMode = "new" then %> function AddMessageCode(code, promptText, InsertText) { if (code != "") { insertCode = prompt(promptText + "\n[" + code + "]xxx[/" + code + "]", InsertText); if ((insertCode != null) && (insertCode != "")){ document.formguest.message.value += "[" + code + "]" + insertCode + "[/" + code + "]"; } } document.formguest.message.focus(); } <% else %> function AddMessageCode(code, promptText, InsertText) { if (code != "") { insertCode = prompt(promptText + "\n<" + code + ">xxx</" + code + ">", InsertText); if ((insertCode != null) && (insertCode != "")){ document.formguest.message.value += "<" + code + ">" + insertCode + "</" + code + ">"; } } document.formguest.message.focus(); } <% end if %> //funzione per il controllo form function CheckForm(){ // campi obbligatori if (document.formguest.msg_name.value==""){ alert("<% = strLangCheckAuthor %>"); return false; } if (document.formguest.msg_oggetto.value==""){ alert("<% = strLangCheckOggetto %>"); return false; } if (document.formguest.message.value==""){ alert("<% = strLangCheckText %>"); return false; } // campi facoltativi // controllo che l'indirizzo email sia corretto if (document.formguest.msg_email.value!=""){ if (document.formguest.msg_email.value.indexOf("@")==-1){ alert("<% = strLangCheckEmail %>"); return false; } if (document.formguest.msg_email.value.indexOf(".")==-1){ alert("<% = strLangCheckEmail %>"); return false; } } // controllo che il campo relativo ad icq sia numerico e di lunghezza >= a 5 caratteri if (document.formguest.msg_icq.value!=""){ if (isNaN(document.formguest.msg_icq.value)){ alert("<% = strLangCheckIcqNumber %>"); return false; } if (document.formguest.msg_icq.value.length < 5){ alert("<% = strLangCheckIcqNumber %>"); return false; } } // controllo che il campo relativo all'homepage contenga http:// if (document.formguest.msg_homepage.value!=""){ if (document.formguest.msg_homepage.value.indexOf("http://")==-1){ alert("<% = strLangCheckHomepage %>"); return false; } } return true; } // funzione per calcolare il numero di caratteri rimanenti per la scrittura del messaggio function MessageCharCount(info, n, max) { Lunghezza = info.value.length; if (Lunghezza > max ) { info.value = info.value.substring(0,max); } n.value = max - info.value.length; } // funzione per aggiungere gli smile al messaggio function AddSmile(code) { document.formguest.message.value += code + " "; document.formguest.message.focus(); } // funzione per il preview del messaggio function OpenPreviewWindow(){ Name = escape(document.formguest.msg_name.value); Email = escape(document.formguest.msg_email.value); City = escape(document.formguest.msg_city.value); Country = escape(document.formguest.msg_country.value); Homepage = escape(document.formguest.msg_homepage.value); Icq = escape(document.formguest.msg_icq.value); Message = escape(document.formguest.message.value); Modo = escape(document.formguest.strMode.value); document.cookie = "Msg_Name=" + Name document.cookie = "Msg_Email=" + Email document.cookie = "Msg_City=" + City document.cookie = "Msg_Country=" + Country document.cookie = "Msg_Homepage=" + Homepage document.cookie = "Msg_Icq=" + Icq document.cookie = "Message=" + Message document.cookie = "StrMode=" + Modo openWin('message_preview.asp','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=500,height=350,left=0,top=0') } // rollover immagini function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <body onLoad="MM_preloadImages('images/bolddown.gif','images/italicdown.gif','images/underdown.gif','images/smiledown.gif')"> <table width="780" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="141"></td> <td width="507"> <div align="center"> <form method=post name="formguest" action="add_message.asp" onSubmit="return CheckForm();" onReset="return confirm('<% = strLangCheckResetForm %>');"> <table width="85%" border="0" cellspacing="1" cellpadding="4" align="center" class="tablemenu"> <tr> <td align="right" width="25%"> Nome</td> <td width="75%" height="31"> <input type="text" name="msg_name" size="25" maxlength="25" class="form" value="<% = msg_name %>"></td> </tr> <tr> <td align="right" width="25%"> Oggetto</td> <td width="75%"><input type="text" name="msg_oggetto" size="25" maxlength="45" class="form" value="<% = msg_oggetto %>"> </td> </tr> <tr> <td align="right" width="25%"></td> <td width="75%" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="75%"> [img]images/boldup.gif[/img]" align="absmiddle"> [img]images/italicup.gif[/img]" align="absmiddle"> [img]images/underup.gif[/img]" align="absmiddle"> [img]images/url_up.gif[/img]" align="absmiddle"> [img]images/smileup.gif[/img]" border="0"> </td> </tr> </table></td> </tr> <tr> <td valign="top" align="right" width="25%"> Diga... <% If strMode = "new" then %> <font class="red"> <% = strLangFormNoHtmlCode %> </font> <% else %> <font class="red"> <% = strLangFormHtmlCode %> </font> <% end if %> <font class="blue"> </font> </td> <td width="75%" valign="top"> <textarea name="message" cols="55" rows="10" class="form" onKeyDown="MessageCharCount(this, document.formguest.msg_characters, <% = maxchar %>)" onKeyUp="MessageCharCount(this, document.formguest.msg_characters, <% = maxchar %>)"><% = message %></textarea> </td> </tr> <tr> <td align="right" > <% = strLangFormCountChar %> :</td> <td><input size="4" value="<% = maxchar %>" name="msg_characters" maxlength="4" class="form" disabled> </td> </tr> <tr> <td valign="top" align="right" width="25%" ></td> <td width="75%" align="left"> <input type="hidden" name="strMode" value="<% = strMode %>"> <% If strMode="edit" Then %> <input type="hidden" name="page" value="<% = page %>"> <input type="hidden" name="Block" value="<% = Block %>"> <input type="hidden" name="msg_id" value="<% = msg_id %>"> <input type="hidden" name="msg_date" value="<% = msg_date %>"> <input type="submit" name="Submit" value="<% = strLangFormEditMessage %>" class="pulsante"> <% Else %> <input type="submit" name="Submit" value="<% = strLangFormAddMessage %>" class="pulsante"> <input type="reset" name="Reset" value="<% = strLangFormReset %>" class="pulsante"> <% End If %> </td> </tr> </table> </form> </div></td> <td width="124"></td> </tr> </table>

Rispondi quotando