how to launch sites with check box and button

Discussion in 'JavaScript' started by Javver, Aug 1, 2009.

  1. #1
    Hi, im a newbie on javascript, i know you guys know this script. I would like to launch several sites with check box and a "Launch Site' button. I would like to put a check mark beside each sites that I would like to launch and click the "Launch Site' button to open each sites.

    Thanks
     
    Javver, Aug 1, 2009 IP
  2. XDMCoder

    XDMCoder Peon

    Messages:
    50
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Qwerty</title>
    <script type="text/javascript">
    function siteOpener()
    {
    	var checkboxArr=document.form1.CheckboxGroup1;
    	for(var i=0;i<checkboxArr.length;i++)
    	{
    		if(checkboxArr[i].checked)
    		{
    			window.open (checkboxArr[i].value,"mywindow"+i); 
    		}
    	}
    }
    </script>
    </head>
    
    <body>
    <form id="form1" name="form1" method="post" action="">
          <input type="checkbox" name="CheckboxGroup1" value="http://google.com" id="CheckboxGroup1_0" />Google
          <input type="checkbox" name="CheckboxGroup1" value="http://yahoo.com" id="CheckboxGroup1_1" />Yahoo
      <input name="openSites" type="button" value="Launch Site" onclick="siteOpener();"/>
    </form>
    </body>
    </html>
    PHP:
     
    XDMCoder, Aug 1, 2009 IP
  3. JavaScriptBank.com

    JavaScriptBank.com Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    JavaScriptBank.com, Aug 2, 2009 IP