HTML Help Forum HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

radio button
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum -> HTML Form
View previous topic :: View next topic  
Author Message
bj31t



Joined: 02 Oct 2009
Posts: 2

Posted: Fri Oct 02, 2009 6:58 am     radio button  

is it possible to have a form go to a different email address depending on which radio button is selected? if this is possible could someone help me with the code

thanks
nikki



Joined: 24 Nov 2008
Posts: 132

Posted: Fri Oct 02, 2009 9:35 am      

What do you mean by " Quote: form go to a different email address "

Do yo want the page to be redirected to different page depending on the radio button selected or send an email to different email address depending on the radio button selected value ?
bj31t



Joined: 02 Oct 2009
Posts: 2

Posted: Fri Oct 02, 2009 9:48 am      

I have 2 radio buttons. when button 1 is selected, it goes to email 1 when the user hits submit. when button 2 is selected, it goes to email 2 when the user hits submit.

thanks
nikki



Joined: 24 Nov 2008
Posts: 132

Posted: Tue Oct 27, 2009 4:00 pm      

Code: <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
   function emailTo(){
      
      var emails = document.getElementsByName("email");
      var emailAdress = null;
      
      for(var i = 0; i < emails.length; i++){
         if(emails[i].checked){
            emailAdress = emails[i].value;
         }
      }
      
      if(emailAdress == null){
         alert("select the email address");
         return;
      }
      
      var mailto_link = 'mailto:'+emailAdress;

       var   win = window.open(mailto_link,'emailWindow');
      if (win && win.open &&!win.closed) win.close();
      
   }
</script>

</head>
<body>


<input type = "radio" name = "email" value = "aatyahoo.com"/>aatyahoo.com
<input type = "radio" name = "email" value = "batyahoo.com">batyahoo.com

<input type = "button" onClick = "emailTo()" value = "Email"/>   
 
</body>
</html>
 
 
DARFUR
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum -> HTML Form
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group