我有一份为我的工作写的出租检查页面。所有选中的 工作除了一个以上的任何东西。像卧室1,浴室1,壁炉1 与其他所有选择一样正常。但是当卧室2,3,4,5, 浴室2,3,4,5等被选中它们根本不起作用。我有一个解决方法,只需点击第一个,然后第二个等使用它。
我在底部包含了bedroom.items.php文件。
提前感谢您的帮助。
<script type="text/javascript">
function fillSecondCombo()
{
var combo1 = document.getElementById('Combobox1');
var combo2 = document.getElementById('Combobox2');
var selected = combo1.options[combo1.options.selectedIndex].value;
if (selected == "attic")
{
<?php include_once "item.lists/attic.item.php"; ?>
}
else
if (selected == "basement")
{
<?php include_once "item.lists/basement.item.php"; ?>
}
else
if (selected == "bathroom1")
{
<?php include_once "item.lists/bathroom.items.php"; ?>
}
else
if (selected == "bathroom2")
{
<?php include_once "item.lists/bathroom.items.php"; ?>
}
else
if (selected == "bathroom3")
{
<?php include_once "item.lists/bathroom.items.php"; ?>
}
else
if (selected == "bathroom4")
{
<?php include_once "item.lists/bathroom.items.php"; ?>
}
else
if (selected == "bathroom5")
{
<?php include_once "item.lists/bathroom.items.php"; ?>
}
else
if (selected == "bedroom1")
{
<?php include_once "item.lists/bedroom.items.php"; ?>
}
else
if (selected == "bedroom2")
{
<?php include_once "item.lists/bedroom.items.php"; ?>
}
else
if (selected == "bedroom3")
{
<?php include_once "item.lists/bedroom.items.php"; ?>
}
else
if (selected == "bedroom4")
{
<?php include_once "item.lists/bedroom.items.php"; ?>
}
else
if (selected == "bedroom5")
{
<?php include_once "item.lists/bedroom.items.php"; ?>
}
else
if (selected == "cooling")
{
<?php include_once "item.lists/cooling.item.php"; ?>
}
else
if (selected == "diningroom")
{
<?php include_once "item.lists/diningroom.item.php"; ?>
}
else
if (selected == "electric")
{
<?php include_once "item.lists/electric.item.php"; ?>
}
else
if (selected == "water")
{
<?php include_once "item.lists/water.item.php"; ?>
}
else
if (selected == "gas")
{
<?php include_once "item.lists/gas.item.php"; ?>
}
else
if (selected == "exterior")
{
<?php include_once "item.lists/exterior.item.php"; ?>
}
else
if (selected == "foundation")
{
<?php include_once "item.lists/foundation.item.php"; ?>
}
else
if (selected == "garage")
{
<?php include_once "item.lists/garage.item.php"; ?>
}
else
if (selected == "heating")
{
<?php include_once "item.lists/heating.item.php"; ?>
}
else
if (selected == "interior")
{
<?php include_once "item.lists/interior.item.php"; ?>
}
else
if (selected == "kitchen")
{
<?php include_once "item.lists/kitchen.item.php"; ?>
}
else
if (selected == "laundry")
{
<?php include_once "item.lists/laundry.item.php"; ?>
}
else
if (selected == "roof")
{
<?php include_once "item.lists/roof.item.php"; ?>
}
else
if (selected == "waterhtr")
{
<?php include_once "item.lists/waterhtr.item.php"; ?>
}
else
if (selected == "livingroom")
{
<?php include_once "item.lists/livingroom.item.php"; ?>
}
else
if (selected == "fireplace1")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "fireplace2")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "fireplace3")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "fireplace4")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "fireplace5")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "fireplace10")
{
<?php include_once "item.lists/fireplace.items.php"; ?>
}
else
if (selected == "poolspa")
{
<?php include_once "item.lists/poolspa.item.php"; ?>
}
else
if (selected == "other")
{
<?php include_once "item.lists/other.item.php"; ?>
}
else
{
combo2.options.length = 0;
}
}
</script>
</head>
<body>
<div id="space"><br></div>
<div id="container">
<button id="AdvancedButton1" type="button" style="position:absolute;left:19px;top:119px;width:137px;height:44px;z-index:12;" onclick="window.location='main.php'" name="Your Account" value="">
<div style="text-align:center"><span style="color:#FFFFFF;font-family:Arial;font-size:16px"><b>Main Menu</b></span></div>
</button>
<button id="AdvancedButton2" type="button" style="position:absolute;left:176px;top:119px;width:124px;height:44px;z-index:13;" onclick="window.location='logout.php'" name="Logout" value="">
<div style="text-align:center"><span style="color:#FFFFFF;font-family:Arial;font-size:16px"><b>Logout</b></span></div>
</button>
<div id="wb_Form1" style="position:absolute;left:20px;top:209px;width:302px;height:574px;z-index:14;">
<form name="Form1" method="post" action="make.all.php" enctype="multipart/form-data" id="Form1" onsubmit="return ValidateForm1(this)">
<textarea name="a4" id="TextArea1" style="position:absolute;left:1px;top:275px;width:279px;height:143px;z-index:0;" rows="7" cols="32" tabindex="4"></textarea>
<div id="wb_Text5" style="position:absolute;left:4px;top:249px;width:152px;height:16px;z-index:1;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Notes: 300 Chars Max.</span></div>
<div id="wb_Text4" style="position:absolute;left:0px;top:164px;width:170px;height:16px;z-index:2;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Passed-Needs Repare-N/A:</span></div>
<select name="a2" size="1" id="Combobox2" style="position:absolute;left:0px;top:109px;width:280px;height:43px;z-index:3;" tabindex="2">
</select>
<div id="wb_Text3" style="position:absolute;left:4px;top:85px;width:140px;height:16px;z-index:4;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Item Being Inspected:</span></div>
<select name="a1" size="1" id="Combobox1" onchange="fillSecondCombo();return false;" style="position:absolute;left:1px;top:32px;width:279px;height:43px;z-index:5;" tabindex="1">
<option value="<?php include "$dirPath/all.areas.php"; ?>"></option>
</select>
<div id="wb_Text2" style="position:absolute;left:4px;top:0px;width:142px;height:16px;z-index:6;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Area Being Inspected:</span></div>
<div id="wb_Text1" style="position:absolute;left:4px;top:436px;width:59px;height:16px;z-index:7;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Photo:</span></div>
<input type="file" id="FileUpload1" style="position:absolute;left:2px;top:452px;width:279px;height:41px;line-height:41px;z-index:8;" name="userfile[]" tabindex="5">
<input type="submit" id="Button1" name="" value="Submit" style="position:absolute;left:44px;top:513px;width:102px;height:30px;z-index:9;" tabindex="6">
<select name="a3" size="1" id="Combobox3" style="position:absolute;left:0px;top:188px;width:280px;height:43px;z-index:10;" tabindex="3">
<option selected value="Passed">Passed</option>
<option value="Needs Repair">Needs Repair</option>
<option value="N/A">N/A</option>
</select>
</form>
</div>
<div id="wb_TextArt1" style="position:absolute;left:18px;top:8px;width:285px;height:100px;z-index:15;">
<img src="images/img0018.png" id="TextArt1" alt="Enter Inspection Data" title="Enter Inspection Data" style="width:285px;height:100px;"></div>
</div>
</body>
</html>
bedroom.items.php
combo2.options.length = 9;
combo2.options[0] = new Option("Electrical Wall Plugs", "Electrical Wall Plugs");
combo2.options[1] = new Option("Walls and Ceiling", "Walls and Ceiling");
combo2.options[2] = new Option("Floor Covering", "Floor Covering");
combo2.options[3] = new Option("Windows (curtains, blinds, etc...)", "Windows (curtains, blinds, etc...)");
combo2.options[4] = new Option("Doors", "Doors");
combo2.options[5] = new Option("Lighting/Light Fixtures", "Light Fixtures");
combo2.options[6] = new Option("Closet(s)", "Closet(s)");
combo2.options[7] = new Option("Smoke Detector(s)", "Smoke Detector(s)");
combo2.options[8] = new Option("Heating/Cooling", "Heating/Cooling");