Humper
12-19-2006, 04:42 PM
I want to write a script so that when a user selects a building number it pulls all the apartment numbers for that building
I want to put it in two <select> </select> format..
so like this
<td>Building</td>
<td><select size="1" name="building" onchange="select_building()">
<option value="whateverbuildingtheypick">whateverbuildingtheypick</option>
</select></td>
<td>Apartment #</td>
<td><select size="1" name="apartment">
<option value="pullfrombuildingselection">pullfrombuildingselection</option>
</select></td>
lets say I have the following building and apartment numbers...
var rooms = new Array(
[ "01", [ "0111A", "0111B", "0111C", "0111D",
"0112A", "0112B", "0112C", "0112D",
"0113A", "0113B", "0113C", "0113D",
"0114A", "0114B", "0114C", "0114D",
"0121A", "0121B", "0121C", "0121D",
"0122A", "0122B", "0122C", "0122D",
"0123A", "0123B", "0123C", "0123D",
"0124A", "0124B", "0124C", "0124D",
"0131A", "0131B", "0131C", "0131D",
"0132A", "0132B", "0132C", "0132D",
"0133A", "0133B", "0133C", "0133D",
"0134A", "0134B", "0134C", "0134D",
"0143A", "0143B", "0143C", "0143D",
"0144A", "0144B", "0144C", "0144D" ] ],
[ "02", [ "0211A", "0211B", "0211C", "0211D",
"0212A", "0212B", "0212C", "0212D",
"0213A", "0213B", "0213C", "0213D",
"0214A", "0214B", "0214C", "0214D",
"0221A", "0221B", "0221C", "0221D",
"0222A", "0222B", "0222C", "0222D",
"0223A", "0223B", "0223C", "0223D",
"0224A", "0224B", "0224C", "0224D",
"0231A", "0231B", "0231C", "0231D",
"0232A", "0232B", "0232C", "0232D",
"0233A", "0233B", "0233C", "0233D",
"0234A", "0234B", "0234C", "0234D",
"0243A", "0243B", "0243C", "0243D",
"0244A", "0244B", "0244C", "0244D" ] ])
can someone help me write this.... BTW this is going to be in a php file.. I dont know if that make a difference because I am very new to javascript.. I guess what I am says is it probably need to loop through the apt number in the actually script...?? any help would be great.
I want to put it in two <select> </select> format..
so like this
<td>Building</td>
<td><select size="1" name="building" onchange="select_building()">
<option value="whateverbuildingtheypick">whateverbuildingtheypick</option>
</select></td>
<td>Apartment #</td>
<td><select size="1" name="apartment">
<option value="pullfrombuildingselection">pullfrombuildingselection</option>
</select></td>
lets say I have the following building and apartment numbers...
var rooms = new Array(
[ "01", [ "0111A", "0111B", "0111C", "0111D",
"0112A", "0112B", "0112C", "0112D",
"0113A", "0113B", "0113C", "0113D",
"0114A", "0114B", "0114C", "0114D",
"0121A", "0121B", "0121C", "0121D",
"0122A", "0122B", "0122C", "0122D",
"0123A", "0123B", "0123C", "0123D",
"0124A", "0124B", "0124C", "0124D",
"0131A", "0131B", "0131C", "0131D",
"0132A", "0132B", "0132C", "0132D",
"0133A", "0133B", "0133C", "0133D",
"0134A", "0134B", "0134C", "0134D",
"0143A", "0143B", "0143C", "0143D",
"0144A", "0144B", "0144C", "0144D" ] ],
[ "02", [ "0211A", "0211B", "0211C", "0211D",
"0212A", "0212B", "0212C", "0212D",
"0213A", "0213B", "0213C", "0213D",
"0214A", "0214B", "0214C", "0214D",
"0221A", "0221B", "0221C", "0221D",
"0222A", "0222B", "0222C", "0222D",
"0223A", "0223B", "0223C", "0223D",
"0224A", "0224B", "0224C", "0224D",
"0231A", "0231B", "0231C", "0231D",
"0232A", "0232B", "0232C", "0232D",
"0233A", "0233B", "0233C", "0233D",
"0234A", "0234B", "0234C", "0234D",
"0243A", "0243B", "0243C", "0243D",
"0244A", "0244B", "0244C", "0244D" ] ])
can someone help me write this.... BTW this is going to be in a php file.. I dont know if that make a difference because I am very new to javascript.. I guess what I am says is it probably need to loop through the apt number in the actually script...?? any help would be great.