Radio To Select Email

[Total: 0    Average: 0/5]

This allows the user to click a radio button to select a mailing list.

Head Code:

<SCRIPT>
<!-- Activate Cloaking Device 

// 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... nnn      DO NOT SEND THIS MESSAGE!";

// Used to display and load email address
var address="";

// Called by onClick in radio buttons
function setAddress(addr)
   {
   address=addr;      
   document.email.display.value=address;
   }

// Called by View Mail Window button
function doMail()
   {
   // Checks if an address has been selected
   if(address!="")
      window.location="mailto:"+address+"?subject=Multiple Email Example"+message;
   else
      {
      alert("nYou must select an address from the list first.");
      return false;
      }
   }

// Called by Reset The Form button
function resetForm()
   {
   address="";
   }


// Deactivate Cloaking -->
</SCRIPT>

Body Code:

<BR>

<CENTER>
<TABLE BORDER="3" CELLPADDING="10" BGCOLOR="#0000FF">
<TR><TD ALIGN="Center">
<FONT SIZE="+0" COLOR="#FFFF00"><B> *** <U>FOR DEMONSTRATION PURPOSES ONLY</U> *** </B></FONT>
</TD></TR></TABLE>
</CENTER>

<BR><BR>

<CENTER>
<FORM NAME="email">

<TABLE BORDER=4  WIDTH=600>
<TR>
<TD align="center">
<INPUT TYPE="radio" NAME="radiobutton" onClick="setAddress('1st_address@where-ever.com')">1st Address
</TD><TD align="center">
<INPUT TYPE="radio" NAME="radiobutton" onClick="setAddress('2nd_address@where-ever.com')">2nd Address
</TD><TD align="center">
<INPUT TYPE="radio" NAME="radiobutton" onClick="setAddress('3rd_address@where-ever.com')">3rd Address
</TD><TD align="center">
<INPUT TYPE="radio" NAME="radiobutton" onClick="setAddress('4th_address@where-ever.com')">4th Address
</TD><TD align="center">
<INPUT TYPE="radio" NAME="radiobutton" onClick="setAddress('5th_address@where-ever.com')">5th Address
</TD></TR>
</TABLE>

<BR><BR>

<INPUT TYPE="text" NAME="display" SIZE="40" VALUE="Choose an address from the list...">

<BR><BR><BR>

<TABLE BORDER="0" WIDTH="500">
<TR>
<TD align="center">
<INPUT TYPE="reset" VALUE="Reset  Form" onClick="resetForm()">
</TD><TD align="center">
<INPUT TYPE="button" VALUE="View Mail Window" onClick="doMail()">
</TD>
</TR>
</TABLE>
</FORM>


</CENTER>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *