Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Use checkbox to control the window style

< html> <head> <title>Open Window</title> <script language="JavaScript" type =" text/javascript"> <!-- function ChangeLink(currentform) {     var window_feature = "";     alert(window_feature);     for (var cb=0; cb<currentform.length - 1; cb++) {         if (currentform[cb].checked)         {              currentform[cb].value = 1;         } else {              currentform[cb].value = 0;         }         window_feature = (window_feature + "," + currentform[cb].name + "= [ic:ccc]"+ currentform[cb].value);     }     window.open("http://www.rntsoft.com", "_blank", window_feature); } //--> </script> </head> <body> <form name="form1">   <input type="checkbox" name="directories" value="0">Directories Option</p>   <P><input type="checkbox" name="location" value="0">Location Option</p>   <P><input type="checkbox" name="menubar" value="0">Menu Bar</p>   <P><input type="checkbox" name="resized" value="0">Allow Window to be Resized</p>   <P><input type="checkbox" name="scrollbars" value="0">Scrollbars</p>   <P><input type="checkbox" name="status" value="0">Status Bar</p>   <P><input type="checkbox" name="toolbar" value="0">Toolbar</p>   <P><input type="button" value="Create Window" name="CreateWin" onClick="ChangeLink(this.form)"></p> </form> </body> </html>