Use checkbox to control the window style : CheckBox « Form « JavaScript Tutorial






<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.java2s.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>








10.7.CheckBox
10.7.1.Checkbox
10.7.2.Checkbox.blur()
10.7.3.Checkbox.checked
10.7.4.Checkbox.click()
10.7.5.Checkbox.defaultChecked
10.7.6.Checkbox.focus()
10.7.7.Checkbox.form
10.7.8.Checkbox.handleEvent()
10.7.9.Checkbox.name
10.7.10.Checkbox.onBlur
10.7.11.Checkbox.onClick
10.7.12.Checkbox.onFocus
10.7.13.Checkbox.type
10.7.14.Checkbox.value
10.7.15.Check if a CheckBox checked
10.7.16.With with RADIO and CheckBox
10.7.17.Use checkbox to control the window style
10.7.18.A Checkbox and an onclick Event Handler
10.7.19.A Checkbox, an onclick Event Handler and show/hide form controls