Respectively, there is a table Zip_VILLE containing:
ID | Zip_Code | City | Country
I use checklists to display these choices.
The user must select in each checklist:
The city
The Zip code
The country
When a user chooses a postal code, I would like the other checklists corresponding to the city and country to be set by default so that the information in the checklists is always the right ones
Currently, a user can choose a City and put a Zip Code of another city for another Country.
Okay, thanks. That’s what I expected, just wanted to be sure.
Question: Is the City to Postcode relation strictly 1:1, or could a City have more than 1 Postcode?
If it is 1:1, then why do you need the user to select both?
Always 1:1
Some users prefer to find a city by selecting the Postal Code. Others prefer to search for the City. And others eliminate the choices by choosing the Country.
That’s a tricky one. The only way I can think of to get the exact behaviour that you are looking for would be to have multiple sets of components and toggle visibility conditions. But that could be overly complex.
My suggestion would be as follows:
Force the selection of the Country first, and then allow the user to select either the City or the Postcode
To get that behaviour, you would need the following:
City selector:
– Visible when Postcode is empty
– Filtered where Country is Screen->Country
Postcode selector:
– Visible when City is empy
– Filtered where Country is Screen->Country
The effect of the above is that the user would initially only see the Country selector. Once they select a Country, then both the City and Postcode selectors would appear, and both would be filtered according to the selected Country. Then as soon as they select from either, the other one would disappear.
No, I was just asking it as an edge case. I was thinking about joining the Country - City - ZIP together in one template, and display them on the front end.
On the back end, you record the ID of that record, so users only have to choose one time.
However, I think that may not be what users typically expect when they enter these types of info.