Bonjour à tous,

Je n'ai jamais utilisé d'ajax et j'avoue etre un peu perdu.
Je possède deux tables de données :
Client
Dossier

Un dossier possède un client avec l'attribut id_client qui fait référence à la table Client.
Dans cette table client il y a
l'id_client, le libellé, le marché et le site

J'arrive à recupéré l'id_client qui par exemple est à 1 et l'id_marche de ce client est égal à 2( qui correspond à la valeur de ma liste déroulante).

Je ne sais pas comment afficher le bon résultat de la liste déroulante

On m'a demandé d'utiliser Ajax pour réaliser ceci.

Quelqun peut-il m'aider

voici mon code HTML avec l'appel de ma fonction javascript :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
<div>
	<label for="id_client">{#labelClientOblig#}</label>
	<select id="id_client" name="data[Dossier][id_client]" onchange="javascript:majClient(this.value);">
		{html_options_escape options=$numclient selected=$Dossier.id_client}
	</select>
  	<select id="client" onchange="javascript:majClient(this.value);" >
		{html_options_escape options=$client selected=$Dossier.id_client}
	</select>
</div>
 
{if (empty($direction))}
<div>
	<label for="id_marche" >{#labelMarcheOblig#}</label>
	<select id="id_marche">
		{html_options_escape options=$MARCHES selected=$Dossier.id_marche}
	</select>
</div>
<div>
	<label for="id_site">{#labelSiteOblig#} </label>
	<select id="id_site">
		{html_options_escape options=$SITES selected=$Dossier.id_site}
	</select>
</div>
{/if}
Merci beaucouo