Populate update page
I have created a dynamic dropdown menu based on the tutorials: Dynamic Dropdown with Data Bridge 2.0 (http://www.webassist.com/tutorials/Dynamic-Dropdowns-with-Data-Bridge-2-0.
It consists of insert, update, detail and results pages. All pages except update work as they should.
In my case, the main menu is countries, and the child menu is cities.
On the update page, of course, I want to show the city that is registered together with the country. But this does not work. I have tried to figure out the problem, but get nowhere. The country is displayed correctly, but the menu of cities is empty. To see the associated cities, I must now first select another country from the country menu. Only then are the associated cities displayed. This is a problem. But I also want the one who is registered to first appear when the update page is displayed, just like country. Hope you understand what I mean.
Here is the select code for the city page (plugins), for the update page:
<select class="form-control" name="cities" id="cities">
<option value="0" <?php if (!(strcmp("", ($WADAbuckets_update->getColumnVal("buc_citID"))))) {echo "selected=\"selected\"";} ?>>Välj Ort</option>
<?php
while(!$rsCity->atEnd()) { //dyn select
?>
<option value="<?php echo($rsCity->getColumnVal("cit_id")); ?>"<?php if (!(strcmp($rsCity->getColumnVal("cit_id"),($WADAbuckets_update->getColumnVal("buc_citID"))))) {echo "selected=\"selected\"";} ?>><?php echo($rsCity->getColumnVal("cit_name")); ?></option>
<?php
$rsCity->moveNext();
} //dyn select
$rsCity->moveFirst();
?>
</select>
Does this look correct?