1
Hi,
I know this question has been asked before. But I'm really stuck after several attempts:
I want to have a dropdown listbox (e.g. Country), by updating of which would in turn dynamically updates the list of a 2nd dropdown list (e.g. Province). The list info all comes from the database.
I understand that this requires incorporation of Javascript codes. I have failed in previous attempts. And want to confirm the correct approach to this.
At the onChange action of Country list, what action should I use?
Possibility 1: Should I be using a form submit action? Then, upon submission, the Province list box be refreshed and retrieve data based on the Country selected? - - - here, I have problem getting the value of the posted Country box. If the name of the dropdown box is 'Country', how should I get the selected value?
Possibility 2: Should Country box's onChange action ,instead of using form submit action, fire an event to create/re-create the Province list? I don't know if this is feasible? By that, will it be using Javascript to do, instead of using PHP to create the Province list?
Would like you experts' help. Appreciate if there is some working example scripts for better understanding.
thanks a lot,
jackling