bonsoir tout le monde(greyhead me comprendra surement :wink: )
voila j'ai créée un formulaire d'inscription à l'aide chronoforms,il contient des textarea ainsi que des listes déroulantes(pays et villes).ce que je voudrais pouvoir faire c'est de choisir une ville après avoir choisi un pays,j'ai donc ecrit à part un code php permettant de faire ceci. pour cela j'ai créée une base de données avec deux tables pays(idpays,nompays)et ville(idville,idpays,nomville).
maintenant avec chronoforms il ya une seule table qui contient tous les champs (nom,prenom,pays,ville,..), donc comment faire pour inserer mon code php et l'adapter s'il le faut pour créer des listes déroulantes liées?
merci
Greyhead added a translation:
I have created a registration form using ChronoForms; it contains textarea and drop down lists (countries and cities). What' I'd like to do is to be able to choose a city after selecting a country. So I wrote a separate php code to do that. I created a database with two tables: countries (idpays, nompays) and city (idville, idpays, nomville).
Now with ChronoForms there is a single table containing all fields (name, surname, country, city ,..), So how can I insert my php code and adapt it where necessary to create linked dropdown lists ?
voila j'ai créée un formulaire d'inscription à l'aide chronoforms,il contient des textarea ainsi que des listes déroulantes(pays et villes).ce que je voudrais pouvoir faire c'est de choisir une ville après avoir choisi un pays,j'ai donc ecrit à part un code php permettant de faire ceci. pour cela j'ai créée une base de données avec deux tables pays(idpays,nompays)et ville(idville,idpays,nomville).
maintenant avec chronoforms il ya une seule table qui contient tous les champs (nom,prenom,pays,ville,..), donc comment faire pour inserer mon code php et l'adapter s'il le faut pour créer des listes déroulantes liées?
merci
Greyhead added a translation:
I have created a registration form using ChronoForms; it contains textarea and drop down lists (countries and cities). What' I'd like to do is to be able to choose a city after selecting a country. So I wrote a separate php code to do that. I created a database with two tables: countries (idpays, nompays) and city (idville, idpays, nomville).
Now with ChronoForms there is a single table containing all fields (name, surname, country, city ,..), So how can I insert my php code and adapt it where necessary to create linked dropdown lists ?
Hi bzzz,
There are a couple of ways to do linked drop-downs like this.
If the list are not too long then you can load all of the information into the page and useJavScript to enable the second drop-down and display the appropriate options. I pefer to do this by using Option groups as you can display and hide option groups very easily.
If the list is long - and town lists often are, then you can use Ajax to look up the values needed for the second list. This isn't very difficult but it's more complex than he Option group approach.
Bob
PS The option group method explained in more detail in Chapter 7 of The ChronoForms Book and there is an introduction to the Ajax approach in Chapter 12.
There are a couple of ways to do linked drop-downs like this.
If the list are not too long then you can load all of the information into the page and useJavScript to enable the second drop-down and display the appropriate options. I pefer to do this by using Option groups as you can display and hide option groups very easily.
If the list is long - and town lists often are, then you can use Ajax to look up the values needed for the second list. This isn't very difficult but it's more complex than he Option group approach.
Bob
PS The option group method explained in more detail in Chapter 7 of The ChronoForms Book and there is an introduction to the Ajax approach in Chapter 12.
thank's for responding me greyhead
indeed i used an ajax code but what i can not understand is where and how could i put my code (steps i should follow)
indeed i used an ajax code but what i can not understand is where and how could i put my code (steps i should follow)
This topic is locked and no more replies can be posted.