Allora......... cediti il codice e modificalo
<HTML>
<HEAD>
<!-- Codice scaricato gratuitamente da HTML.it, il sito italiano sul Web publishing
http://www.html.it -->
<TITLE>Esempi Javascript: esempio pratico </TITLE>
<SCRIPT>
<!-- Activate Cloaking Device
//************************************************** *************
// Multiple Email Addresses From A Dropdown Menu
// by Tim Wallace (timothy@essex1.com)
//
// Copyright (C)1997 Timothy Wallace. All Rights Reserved.
//************************************************** *************
// Identify browser - not all browsers handle email the same.
var browser=navigator.appName + " " + navigator.appVersion;
// Add a message to the body for Netscape 4.0
var message="";
if(browser.substring(0, 12)=="Netscape 4.0")
message="&body=This is for demonstration only... \n\n\n NON SPEDIRE QUESTO MESSAGGIO!";
// Used to display and load email address
var address="";
// Called by onChange in select tag
function setAddress()
{
// Sets myindex to index of selected menu item
var myindex=document.email.address.selectedIndex;
// If an item other than 0 has been chosen
if (myindex>=1)
{
address=document.email.address.options[myindex].value;
document.email.display.value=address;
return true;
}
// If no item has been chosen
else
{
document.email.display.value="Choose an address from the menu...";
return false;
}
}
// Called by View Mail Window button
function doMail()
{
// Checks if an address has been selected
if(setAddress())
window.location="mailto:"+address+"?subject=Prova per menu multipli"+message;
else
{
alert("\nYou must select an address from the menu first.");
return false;
}
}
// Called by Reset The Form button - impelmented for Netscape 2
function resetForm()
{
document.email.address.options[0].selected = true;
}
// Called by About Netscape 2 button
function aboutNet2()
{
alert("\nThe onChange used to display the address does not work right with Netscape 2.\n\nWith this browser, make a selection and then click within the frame to see the address.");
}
// Called by View Source button - displays text file of source.
function viewSource()
{
alert("\nA text file with source will be loaded to the full window.\n\nUse your browser BACK button to return to the examples.");
top.window.location.href="js-mail1.txt";
}
// Deactivate Cloaking -->
</SCRIPT>
</HEAD>
<BODY bgcolor="white">
<CENTER><FORM NAME="email">
<SELECT NAME="address" SIZE=1 onChange="setAddress()">
<OPTION SELECTED VALUE="">Selezione qui un indirizzo e-mail
<OPTION VALUE="pippo@pluto.it">Pippo
<OPTION VALUE="paperino@pluto.it">Paperino
<OPTION VALUE="paperone@pluto.it">Paperone
<OPTION VALUE="rossi@bianchi.com">Anonimo
<OPTION VALUE="bianchi@rossi.it">Anonimo
</SELECT>
<INPUT TYPE="text" NAME="display" SIZE="40" VALUE="Scegli un indirizzo dal menu">
<INPUT TYPE="button" VALUE="Scrivi una mail" onClick="doMail()">
</CENTER>
</body>
</html>

Rispondi quotando