Skip to main content

Dynamic Dropdown Menu if-else does not become dynamic



I have two dropdown menus, im having trouble with making the options for the second dropwdown to be dependent on the choice on the first dropdown menu.







$city="";

$formcontent =<<<EOT

<label>Assumed Bitten City : </label>

<select name="AssumedBittenCity" id="AssumedBittenCity">

<option value="0">Make a Selection</option>

<option value="Caloocan City">Caloocan City</option>

<option value="Las Pi&#241;as City">Las Pi&#241;as City</option>

<option value="Makati City">Makati City</option>

<option value="Malabon City">Malabon City</option>

<option value="Mandaluyong City">Mandaulyong City</option>

<option value="Manila City">Manila City</option>

<option value="Marikina City">Marikina City</option>

<option value="Muntinlupa City">Muntinlupa City</option>

<option value="Navotas City">Navotas City</option>

<option value="Para&#241;aque City">Para&#241;aque City</option>

<option value="Pasay City">Pasay City</option>

<option value="Pasig City">Pasig City</option>

<option value="Pateros City">Pateros City</option>

<option value="Quezon City" $city="Quezon City">Quezon City</option>

<option value="San Juan City">San Juan City</option>

<option value="Taguig City">Taguig City</option>

<option value="Valenzuela City">Valenzuela City</option>

</select><br></br>



<label>Assumed Bitten Street : </label>

<Select name="AssumedBittenStreet" id="AssumedBittenStreet">

<option value="0">Make a Selection</option>

EOT;



if($city="Quezon City"){





$formcontent.=<<<EOT



<option value="Kamuning Road">Kamuning Road</option>

<option value="K-1st Street">K-1st Street</option>

<option value="K-2nd Street">K-2nd Street</option>

<option value="K-3rd Street">K-3rd Street</option>

<option value="K-4th Street">K-4th Street</option>

<option value="K-5th Street">K-5th Street</option>

<option value="K-6th Street">K-6th Street</option>

<option value="K-7th Street">K-7th Street</option>

<option value="K-8th Street">K-8th Street</option>

<option value="K-D Street">K-D Street</option>

<option value="K-F Street">K-F Street</option>

<option value="K-Eth Street">K-Eth Street</option>

<option value="Eulogio Rodriguez Sr. Avenue">Eulogio Rodriguez Sr. Avenue</option>

<option value="Balete Drive">Balete Drive</option>

<option value="Park Ave">Park Ave</option>

<option value="L. Sianghio Street">L. Sianghio Street</option>

<option value="Teodoro Gener Street">Teodoro Gener Street</option>

<option value="Judge Damien Jimenez Street">Judege Damien Jimenez Street</option>

<option value="Scout Castor Street">Scout Castor Street</option>

<option value="Scout Lozano Street">Scout Lozano Street</option>

<option value="Scout Dr. Lazcano Street">Scout Lazcano Street</option>

<option value="Scout De Guia Street">Scout De Guia Street</option>

<option value="Scout Torillo Street">Scout Torillo Street</option>

<option value="Scout Ybardolaza Street">Scout Ybardolaza Street</option>

<option value="Scout Gandia Street">Scout Gandia Street</option>

<option value="Scout FuentebellaStreet">Scout Castor Street</option>

<option value="Scout Fernandez Street">Scout Fernandez Street</option>

<option value="Scout Limbaga Street">Scout Limbaga Street</option>

<option value="Scout Rallos Street">Scout Rallos Street</option>

<option value="Scout Tuason Street">Scout Tuason Street</option>

<option value="Scout Tobias Street">Scout Tobias Street</option>

<option value="Scout Santiago Street">Scout Santiago Street</option>

<option value="Scout Reyes Street">Scout Reyes Street</option>

<option value="Scout Magbanua Street">Scout Magbanua Street</option>

<option value="Scout Ojeda Street">Scout Ojeda Street</option>

<option value="Scout Chuatoco Street">Scout Chuatoco Street</option>

EOT;







currently this does not work, and I have no knowledge on javascript. What basic/simple solution can I do with this?


Comments

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex