Bonjour,

J'ai un formulaire de suivi d'intervention à remplir. Pour cela, je sélectionne mon client via une liste déroulante. Je n'arrive pas à remplir le champ "e-mail du client" automatiquement, sans recharger ma page après avoir choisi mon client dans ma liste (dans ma table client : idclient, nom, email, tel, ...)

Code de ma page de formulaire (attention beaucoup de code)

Code php : 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
<script language="JavaScript">
/*
Popup calendrier
*/
var ppcDF = "Y-m-d";
var ppcMN = new Array("Janvier","Février","Mars","April","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre");
var ppcWN = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var ppcER = new Array(4);
ppcER[0] = "Required DHTML functions are not supported in this browser.";
ppcER[1] = "Target form field is not assigned or not accessible.";
ppcER[2] = "Sorry, the chosen date is not acceptable. Please read instructions on the page.";
ppcER[3] = "Unknown error occured while executing this script.";
var ppcUC = false;
 var ppcUX = 4;
 var ppcUY = 4;
 
/* Do not edit below this line unless you are sure what are you doing! */
 
var ppcIE=(navigator.appName == "Microsoft Internet Explorer");
var ppcNN=((navigator.appName == "Netscape")&&(document.layers));
var ppcTT="<table width=\"200\" cellspacing=\"1\" cellpadding=\"2\" border=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\">\n";
var ppcCD=ppcTT;var ppcFT="<font face=\"MS Sans Serif, sans-serif\" size=\"1\" color=\"#000000\">";var ppcFC=true;
var ppcTI=false;var ppcSV=null;var ppcRL=null;var ppcXC=null;var ppcYC=null;
var ppcML=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var ppcWE=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var ppcNow=new Date();var ppcPtr=new Date();
if (ppcNN) {
 window.captureEvents(Event.RESIZE);
 window.onresize = restoreLayers;
 document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
 document.onmousedown = recordXY;
 document.onmouseup = confirmXY;}
function restoreLayers(e) {
 if (ppcNN) {
  with (window.document) {
   open("text/html");
   write("<html><head><title>Restoring the layer structure...</title></head>");
   write("<body bgcolor=\"#FFFFFF\" onLoad=\"history.go(-1)\">");
   write("</body></html>");
   close();}}}
function recordXY(e) {
 if (ppcNN) {
  ppcXC = e.x;
  ppcYC = e.y;
  document.routeEvent(e);}}
function confirmXY(e) {
 if (ppcNN) {
  ppcXC = (ppcXC == e.x) ? e.x : null;
  ppcYC = (ppcYC == e.y) ? e.y : null;
  document.routeEvent(e);}}
function getCalendarFor(target,rules) {
 ppcSV = target;
 ppcRL = rules;
 if (ppcFC) {setCalendar();ppcFC = false;}
 if ((ppcSV != null)&&(ppcSV)) {
  if (ppcIE) {
   var obj = document.all['PopUpCalendar'];
   obj.style.left = document.body.scrollLeft+event.clientX;
   obj.style.top  = document.body.scrollTop+event.clientY;
   obj.style.visibility = "visible";}
  else if (ppcNN) {
   var obj = document.layers['PopUpCalendar'];
   obj.left = ppcXC
   obj.top  = ppcYC
   obj.visibility = "show";}
  else {showError(ppcER[0]);}}
 else {showError(ppcER[1]);}}
function switchMonth(param) {
 var tmp = param.split("|");
 setCalendar(tmp[0],tmp[1]);}
function moveMonth(dir) {
 var obj = null;
 var limit = false;
 var tmp,dptrYear,dptrMonth;
 if (ppcIE) {obj = document.ppcMonthList.sItem;}
 else if (ppcNN) {obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
 else {showError(ppcER[0]);}
 if (obj != null) {
  if ((dir.toLowerCase() == "back")&&(obj.selectedIndex > 0)) {obj.selectedIndex--;}
  else if ((dir.toLowerCase() == "forward")&&(obj.selectedIndex < 12)) {obj.selectedIndex++;}
  else {limit = true;}}
 if (!limit) {
  tmp = obj.options[obj.selectedIndex].value.split("|");
  dptrYear  = tmp[0];
  dptrMonth = tmp[1];
  setCalendar(dptrYear,dptrMonth);}
 else {
  if (ppcIE) {
   obj.style.backgroundColor = "#FF0000";
   window.setTimeout("document.ppcMonthList.sItem.style.backgroundColor = '#FFFFFF'",50);}}}
function selectDate(param) {
 var arr   = param.split("|");
 var year  = arr[0];
 var month = arr[1];
 var date  = arr[2];
 var ptr = parseInt(date);
 ppcPtr.setDate(ptr);
 if ((ppcSV != null)&&(ppcSV)) {
  if (validDate(date)) {ppcSV.value = dateFormat(year,month,date);hideCalendar();}
  else {showError(ppcER[2]);if (ppcTI) {clearTimeout(ppcTI);ppcTI = false;}}}
 else {
  showError(ppcER[1]);
  hideCalendar();}}
function setCalendar(year,month) {
 if (year  == null) {year = getFullYear(ppcNow);}
 if (month == null) {month = ppcNow.getMonth();setSelectList(year,month);}
 if (month == 1) {ppcML[1]  = (isLeap(year)) ? 29 : 28;}
 ppcPtr.setYear(year);
 ppcPtr.setMonth(month);
 ppcPtr.setDate(1);
 updateContent();}
function updateContent() {
 generateContent();
 if (ppcIE) {document.all['monthDays'].innerHTML = ppcCD;}
 else if (ppcNN) {
  with (document.layers['PopUpCalendar'].document.layers['monthDays'].document) {
   open("text/html");
   write("<html>\n<head>\n<title>DynDoc</title>\n</head>\n<body bgcolor=\"#FFFFFF\">\n");
   write(ppcCD);
   write("</body>\n</html>");
   close();}}
 else {showError(ppcER[0]);}
 ppcCD = ppcTT;}
function generateContent() {
 var year  = getFullYear(ppcPtr);
 var month = ppcPtr.getMonth();
 var date  = 1;
 var day   = ppcPtr.getDay();
 var len   = ppcML[month];
 var bgr,cnt,tmp = "";
 var j,i = 0;
 for (j = 0; j < 7; ++j) {
  if (date > len) {break;}
  for (i = 0; i < 7; ++i) {
   bgr = ((i == 0)||(i == 6)) ? "#FFFFCC" : "#FFFFFF";
   if (((j == 0)&&(i < day))||(date > len)) {tmp  += makeCell(bgr,year,month,0);}
   else {tmp  += makeCell(bgr,year,month,date);++date;}}
  ppcCD += "<tr align=\"center\">\n" + tmp + "</tr>\n";tmp = "";}
 ppcCD += "</table>\n";}
function makeCell(bgr,year,month,date) {
 var param = "\'"+year+"|"+month+"|"+date+"\'";
 var td1 = "<td width=\"20\" bgcolor=\""+bgr+"\" ";
 var td2 = (ppcIE) ? "</font></span></td>\n" : "</font></a></td>\n";
 var evt = "onMouseOver=\"this.style.backgroundColor=\'#FF0000\'\" onMouseOut=\"this.style.backgroundColor=\'"+bgr+"\'\" onMouseUp=\"selectDate("+param+")\" ";
 var ext = "<span Style=\"cursor: hand\">";
 var lck = "<span Style=\"cursor: default\">";
 var lnk = "<a href=\"javascript:selectDate("+param+")\" onMouseOver=\"window.status=\' \';return true;\">";
 var cellValue = (date != 0) ? date+"" : "&nbsp;";
 if ((ppcNow.getDate() == date)&&(ppcNow.getMonth() == month)&&(getFullYear(ppcNow) == year)) {
  cellValue = "<b>"+cellValue+"</b>";}
 var cellCode = "";
 if (date == 0) {
  if (ppcIE) {cellCode = td1+"Style=\"cursor: default\">"+lck+ppcFT+cellValue+td2;}
  else {cellCode = td1+">"+ppcFT+cellValue+td2;}}
 else {
  if (ppcIE) {cellCode = td1+evt+"Style=\"cursor: hand\">"+ext+ppcFT+cellValue+td2;}
  else {
   if (date < 10) {cellValue = "&nbsp;" + cellValue + "&nbsp;";}
   cellCode = td1+">"+lnk+ppcFT+cellValue+td2;}}
 return cellCode;}
function setSelectList(year,month) {
 var i = 0;
 var obj = null;
 if (ppcIE) {obj = document.ppcMonthList.sItem;}
 else if (ppcNN) {obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
 else {/* NOP */}
 while (i < 13) {
  obj.options[i].value = year + "|" + month;
  obj.options[i].text  = ppcMN[month] + " " + year;
  i++;
  month++;
  if (month == 12) {year++;month = 0;}}}
function hideCalendar() {
 if (ppcIE) {document.all['PopUpCalendar'].style.visibility = "hidden";}
 else if (ppcNN) {document.layers['PopUpCalendar'].visibility = "hide";window.status = " ";}
 else {/* NOP */}
 ppcTI = false;
 setCalendar();
 ppcSV = null;
 if (ppcIE) {var obj = document.ppcMonthList.sItem;}
 else if (ppcNN) {var obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
 else {/* NOP */}
 obj.selectedIndex = 0;}
function showError(message) {
 window.alert("[ PopUp Calendar ]\n\n" + message);}
function isLeap(year) {
 if ((year%400==0)||((year%4==0)&&(year%100!=0))) {return true;}
 else {return false;}}
function getFullYear(obj) {
 if (ppcNN) {return obj.getYear() + 1900;}
 else {return obj.getYear();}}
function validDate(date) {
 var reply = true;
 if (ppcRL == null) {/* NOP */}
 else {
  var arr = ppcRL.split(":");
  var mode = arr[0];
  var arg  = arr[1];
  var key  = arr[2].charAt(0).toLowerCase();
  if (key != "d") {
   var day = ppcPtr.getDay();
   var orn = isEvenOrOdd(date);
   reply = (mode == "[^]") ? !((day == arg)&&((orn == key)||(key == "a"))) : ((day == arg)&&((orn == key)||(key == "a")));}
  else {reply = (mode == "[^]") ? (date != arg) : (date == arg);}}
 return reply;}
function isEvenOrOdd(date) {
 if (date - 21 > 0) {return "e";}
 else if (date - 14 > 0) {return "o";}
 else if (date - 7 > 0) {return "e";}
 else {return "o";}}
function dateFormat(year,month,date) {
 if (ppcDF == null) {ppcDF = "d/m/Y";}
 var day = ppcPtr.getDay();
 var crt = "";
 var str = "";
 var chars = ppcDF.length;
 for (var i = 0; i < chars; ++i) {
  crt = ppcDF.charAt(i);
  switch (crt) {
   case "M": str += ppcMN[month]; break;
   case "m": str += (month<9) ? ("0"+(++month)) : ++month; break;
   case "Y": str += year; break;
   case "y": str += year.substring(2); break;
   case "d": str += ((ppcDF.indexOf("m")!=-1)&&(date<10)) ? ("0"+date) : date; break;
   case "W": str += ppcWN[day]; break;
    default: str += crt;}}
 return unescape(str);}
</script>
<!-- Import des modules javascript -->
<script language="javascript" type="text/javascript" src="./js/JSFX_FadingRollovers.js"></script>
<script language="javascript" type="text/javascript" src="js/infobulle.js"></script>
<script language="javascript" type="text/javascript" src="js/time.js"></script>
<script language="javascript" type="text/javascript" src="ajax.js"></script>
<!-- Script utiliser pour la gestion des heures de début et de fin -->
<script language="javascript" type="text/javascript">
<!--
function clickhdeb() {
	variable_date=new Date(); 
	hrs=variable_date.getHours();
	if (hrs <= 12){
		document.forminter.hdeb.value = "09:00";
	}
	if (hrs >= 13 && hrs < 17){
		document.forminter.hdeb.value = "13:30";
	}
	document.forminter.hdeb.select();
}
 
function clickhfin() {
	variable_date=new Date(); 
	hrs=variable_date.getHours();
	if (hrs < 10) {
		hrs = "0" + hrs
	}
	mns=variable_date.getMinutes();
	if (mns < 10) {
		mns = "0" + mns
	}
	document.forminter.hfin.value = hrs + ":" + mns;
	document.forminter.hfin.select();
}
 
function addcar(click) {
	curtext = forminter.elements[click].value;
	if (curtext.length == 2){
		curtext = curtext + ":00";
	}
	if (curtext.length == 3){
		hrs = curtext.substring(0,1);
		mns = curtext.substring(1,3);
		curtext = hrs + ":" + mns;
	}
	if (curtext.length == 4){
		if (curtext.substring(1,2) == ":"){
			hrs = "0" + curtext.substring(0,1);
			mns = curtext.substring(2,4);
		}
		else {
			hrs = curtext.substring(0,2);
			mns = curtext.substring(2,4);
		}
		curtext = hrs + ":" + mns;
	}
	forminter.elements[click].value = curtext;
}
//-->
</script>
 
<!-- Script utilisé pour le rollover -->
<script type="text/javascript" language="javascript">
<!--
JSFX.Rollover("action", "./images/<?php echo $theme; ?>/action.png");
JSFX.Rollover("inter", "./images/<?php echo $theme; ?>/inter.png");
JSFX.Rollover("attach", "./images/<?php echo $theme; ?>/attach.png");
JSFX.Rollover("rapport", "./images/<?php echo $theme; ?>/rapport.png");
JSFX.Rollover("printer", "./images/<?php echo $theme; ?>/printer.png");
JSFX.Rollover("disconnect", "./images/<?php echo $theme; ?>/disconnect.png");
JSFX.Rollover("add", "./images/<?php echo $theme; ?>/add.png");
JSFX.Rollover("enregistrer", "./images/<?php echo $theme; ?>/enregistrer.png");
JSFX.Rollover("exporter", "./images/<?php echo $theme; ?>/export.png");
JSFX.Rollover("save", "./images/<?php echo $theme; ?>/save.png");
//-->
</script>
<script language="javascript">
function verif() {
if (document.forminter.nom.value == "-1" ) {
alert("Merci de sélectionner un nom !" );
return false;
} else {
document.forminter.submit();
}
}
</script>
 
<?php
	if (isset($_GET['action'])) $action=$_GET['action'];
	if (isset($_POST['action'])) $action=$_POST['action'];
?>
<!-- Elements concernant le style de la page -->
<link rel="stylesheet" type="text/css" href="css/<?php echo $theme; ?>.css">
<style type="text/css">
<!--
.Style1 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; font-style: italic; font-weight: bold; }
.Style2 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #006600; }
.Style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 16px; color: #006600;}
.Style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: xx-small; color: #006600; }
-->
</style>
<div class="entete" >
<?php 
  include('haut1.php');  // Nous appelons l'entete du site
?>
</div>
<div class="colonneGauche" >
<?php 
  include('menu.php');   // Nous appelons notre menu
?>
</div>
<div class="colonneDroite">
<head>
<script language="javascript" type="text/javascript" src="ajax.js" ></script>
<link href="vista_toolbar/style1.css" media="all" rel="stylesheet" type="text/css" />
<body>
<script language="JavaScript">
if (document.all) {
 document.writeln("<div id=\"PopUpCalendar\" style=\"position:absolute; left:0px; top:0px; z-index:7; width:200px; height:77px; overflow: visible; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout(\'hideCalendar()\',500)\">");
 document.writeln("<div id=\"monthSelector\" style=\"position:absolute; left:0px; top:0px; z-index:9; width:181px; height:27px; overflow: visible; visibility:inherit\">");}
else if (document.layers) {
 document.writeln("<layer id=\"PopUpCalendar\" pagex=\"0\" pagey=\"0\" width=\"200\" height=\"200\" z-index=\"100\" visibility=\"hide\" bgcolor=\"#FFFFFF\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout('hideCalendar()',500)\">");
 document.writeln("<layer id=\"monthSelector\" left=\"0\" top=\"0\" width=\"181\" height=\"27\" z-index=\"9\" visibility=\"inherit\">");}
else {
 document.writeln("<p><font color=\"#FF0000\"><b>Error ! The current browser is either too old or too modern (usind DOM document structure).</b></font></p>");}
</script>
<noscript><p><font color="#FF0000"><b>JavaScript n'est pas activé !</b></font></p></noscript>
<table border="1" cellspacing="1" cellpadding="2" width="200" bordercolorlight="#000000" bordercolordark="#000000" vspace="0" hspace="0"><form name="ppcMonthList"><tr><td align="center" bgcolor="#CCCCCC"><a href="javascript:moveMonth('Back')" onMouseOver="window.status=' ';return true;"><font face="Verdana" size="2" color="#000000"><b>< </b></font></a><font face="Verdana" size="1"> 
<select name="sItem" onMouseOut="if(ppcIE){window.event.cancelBubble = true;}" onChange="switchMonth(this.options[this.selectedIndex].value)" style="font-family: 'Verdana'; font-size: 9pt"><option value="0" selected>Janvier 2000</option><option value="1">Février 2000</option><option value="2">Mars 2000</option><option value="3">Avril 2000</option><option value="4">Mai 2000</option><option value="5">Juin 2000</option><option value="6">Juillet 2000</option><option value="7">Août 2000</option><option value="8">Septembre 2000</option><option value="9">Octobre 2000</option><option value="10">Novembre 2000</option><option value="11">Décembre 2000</option><option value="0">Janvier 2001</option></select></font><a href="javascript:moveMonth('Forward')" onMouseOver="window.status=' ';return true;"><font face="Verdana" size="2" color="#000000"><b> ></b></font></a></td></tr></form></table>
<table border="1" cellspacing="1" cellpadding="2" bordercolorlight="#000000" bordercolordark="#000000" width="200" vspace="0" hspace="0"><tr align="center" bgcolor="#CCCCCC"><td width="20" bgcolor="#FFFFCC"><b><font face="Verdana" size="1">D</font></b></td><td width="20"><b><font face="Verdana" size="1">L</font></b></td><td width="20"><b><font face="Verdana" size="1">Ma</font></b></td><td width="20"><b><font face="Verdana" size="1">Me</font></b></td><td width="20"><b><font face="Verdana" size="1">J</font></b></td><td width="20"><b><font face="Verdana" size="1">V</font></b></td><td width="20" bgcolor="#FFFFCC"><b><font face="Verdana" size="1">S</font></b></td></tr></table>
<script language="JavaScript">
if (document.all) {
 document.writeln("</div>");
 document.writeln("<div id=\"monthDays\" style=\"position:absolute; left:0px; top:52px; z-index:8; width:200px; height:17px; overflow: visible; visibility:inherit; background-color: #FFFFFF; border: 1px none #000000\"> </div></div>");}
else if (document.layers) {
 document.writeln("</layer>");
 document.writeln("<layer id=\"monthDays\" left=\"0\" top=\"52\" width=\"200\" height=\"17\" z-index=\"8\" bgcolor=\"#FFFFFF\" visibility=\"inherit\"> </layer></layer>");}
else {/*NOP*/}
</script>
 
<table width="1020" border="0" align="center" background="images/milieu1.gif">
  <tr>
    <td width="1020"><table width="925" border="0" align="center">
      <tr>
        <td width="892">
		<table width="102%" border="0" cellspacing="1" cellpadding="0" align="center" height="292" bgcolor="#666666">
  <tr> 
    <td width="100%" height="30" align="center" bgcolor="#FFFFFF"><u><span class="Style3">SAISIE D'UNE INTERVENTION</span></u></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#FFFFFF"><br>
<form name="forminter" method="POST" action="add_intervention.php" enctype="multipart/form-data">
<p>
  <select size=1 name="nom" id="idnom" onBlur="ajaxcdcl()">
    <option value="-1">Choisir un client</option>
 
    <?php
require("protec/passe/conf.php3");
$db_link = mysql_connect($sql_serveur,$sql_user,$sql_passwd);
$dbbase="altaisdeassist";
mysql_select_db($dbbase);
// Récupération des informations triées par ordre alphabétique 
$sql = "SELECT DISTINCT nom FROM client ORDER BY nom";
$ReqLog = mysql_query($sql,$db_link) or die("erreur de connexion");
while ($nom = mysql_fetch_row($ReqLog)) {
        echo '
                <option value="'.$nom[0].'">'.$nom[0].'</option>'; 
}
 
if (isset($_POST['action']) && $_POST['action'] == 'add'){
		$stamphdeb = strtotime('01/01/1970 ' . $_POST['hdeb']);
		$stamphfin = strtotime('01/01/1970 ' . $_POST['hfin']);
		}
		$htotal = ($stamphfin - $stamphdeb);
//upload
$an = date("Y");
$mois = date("m");
$day = date("d");
 
function getName($pre='',$post='')
{
	$name=time();
	$name=str_replace(array(' ','.'),'',$name);
	$cle=mt_rand(0,9);
	return $pre.$name.$cle.'.'.$post;
}
 
 
?>
  </select> 
 
  <center>
  </p>
<table width="624" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="189"><div align="right"><font face="Verdana, Geneva, sans-serif" color="#990000" size="2"><strong>E-mail du client :</strong></font>&nbsp;&nbsp;</div></td>
    <td width="378"><div align="left">
 
 
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function changement() {
  if (document.getElementById('cb').checked)
     document.getElementById('email').disabled=true;
  else
     document.getElementById('email').disabled=false;
}
</script>
        <input type="text" name="email" id="email" size="60" maxlenght="64">
    </div></td>
    <td width="57">&nbsp;<input type="checkbox" id="cb" onClick="changement()">
      <img src="images/interdit.gif" alt="Pas d'envoi de rapport par e-mail : cocher la case." width="22" height="22" align="absmiddle"></td>
  </tr>
</table>
<br>
<table width="828" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="143" class="Style3"><div align="center" class="Style7">DATE</div></td>
    <td width="130" class="Style3"><div align="center" class="Style7">HEURE DEBUT</div></td>
    <td width="130" class="Style3"><div align="center" class="Style7">HEURE FIN</div></td>
    <td width="260" class="Style3"><div align="center" class="Style7">INTERLOCUTEUR</div></td>
    <td width="165" class="Style3"><div align="center" class="Style7">TECHNICIEN</div></td>
  </tr>
  <tr>
    <td><div align="center">
      <input type="text" name="dateinterv" size="15" maxlength="13" onFocus="getCalendarFor(this); this.blur()">
    </div></td>
    <td><div align="center">
      <input type="text" name="hdeb" onClick="clickhdeb()" onChange="addcar('hdeb')" size="10">
    </div></td>
    <td><div align="center">
      <input type="text" name="hfin" onClick="clickhfin()" onChange="addcar('hfin')" size="10">
    </div></td>
    <td><div align="center">
      <input type="text" name="interloc" size="35" maxlength="50">
    </div></td>
    <td><div align="center">
      <select name="technicien">
        <option value="Benoît">Benoît</option>        
		<option value="Jean-françois">Jean-François</option>
        <option value="Patricia">Patricia</option>
		<option value="Cindy">Cindy</option>
		<option value="Alexandre">Alexandre</option>
      </select>
    </div></td>
  </tr>
</table>
*
*
*
<br>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;<u><span class="Style1">Description de l'intervention :
</span></u>
<p align="center"><textarea name="libelle" rows="8" cols="100" value="Description de l'intervention"></textarea>
<p>
 
<img src="./images/<?php echo $theme; ?>/valider_intervention.png" alt="Valider l'intervention et l'envoyer par e-mail au client." name="add" border="0""
				onclick="verif()">
<input type="hidden" name="action" value="add">
</form>    </td>
  </tr>
  <tr>
    <td width="1015" height="50" align="center" valign="top" bgcolor="#FFFFFF"><div id="vista_toolbar" align="center">
<ul>
<li><a href="ajout_client.php"><span><img align="left" src="vista_toolbar/contrat.png"
alt="Créer un contrat" />Créer un contrat</span></a></li>
<li><a href="liste_client.php"><span><img align="left" src=
"vista_toolbar/liste_contrat.png" alt="Liste des contrats" />Liste des contrats</span></a></li>
<li><a href="ajout_intervention.php"><span><img align="left" src=
"vista_toolbar/intervention.png" alt=
"Saisir une intervention" />Saisir une intervention</span></a></li>
<li><a href="choix_liste_intervention.php"><span><img align="left" src=
"vista_toolbar/chart.gif" alt="Liste des interventions" />Liste des interventions</span></a></li>
<li><a class="right" href="delogue.php"><span><img align="left" src=
"vista_toolbar/deconnecter.png" alt="Se déconnecter" />Se déconnecter</span></a><br>
</li>
</ul>
</div>
</td>
  </tr>
</table>
		</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</div>
<div class="pied">
<?php 
  include('bas1.php');   // Nous appelons le pied de page
?>
</div>
 
 
Code AJAX/Javascript (fichier ajax.js)
 
var xhr = null;
 
// Fonction de creation de l'objet XMLHttpRequest qui resservira pour chaques fonctions AJAX
function getXhr()
 {
  if(window.XMLHttpRequest) xhr = new XMLHttpRequest(); 
  else if(window.ActiveXObject)
   {  
    try
     {
      xhr = new ActiveXObject("Msxml2.XMLHTTP");
     }
    catch (e)
     {
      xhr = new ActiveXObject("Microsoft.XMLHTTP");
     }
   }
  else 
   { 
    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest, veuillez le mettre à jour"); 
    xhr = false; 
   } 
 }
 
function submitChange ( ){
    // --- Modification du parametre action qui va permettre d'appeller la bonne méthode JAVA a éxécuter.
    document.forms[0].action.value = 'change';
    // --- Soumission du formulaire.
    document.forms[0].submit;
}
 
 
// D'apres une valeur, nous voulons en afficher 3
// revendeur, adresserev, cdpostrev
// nous aurons besoin de nous connecter à une base pour recuperer les valeurs
function ajaxcdcl()
 {
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      // Nous recuperons ce coup ci le retour dans une variable
      //var nom = xhr.responseText;
	  var nom = document.forms['idnom'].nom.value;
      // Nous appliquons les valeurs récupérées au element correspondant
      document.getElementById('idemail').value;
      }
   }
  xhr.open("POST",'ajax/ajaxrecupemail.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  nom = document.getElementById('nom').value;
  xhr.send("nom="+nom);
 }
 
Code ajaxrecupemail.php :
 
<?php
// connexion à la base
require("protec/passe/conf.php3");
$db_link = mysql_connect($sql_serveur,$sql_user,$sql_passwd);
$dbbase="altaisdeassist";
mysql_select_db($dbbase);
 
$req = mysql_query("SELECT email FROM client WHERE nom =".$_POST["cdcl"]);
header("Content-type:text/xml");
while($res = mysql_fetch_array($req))
 {
  // Concatenation des resultats dans une chaine
  // Utilisation d'un caractere séparateur ( £ ) que nous avons peu de chance de retrouver dans une chaine de caracteres francais.
  echo "$res[email]";
 }
?>

Je suis novice en AJAX et n'arrive vraiment pas à faire ce que je souhaite. mon formulaire fonctionne très bien (malgré sa mauvaise conception je l'avoue). Par contre je sais qu'il y a de grosses erreurs dans les 2 suivants mais je ne comprends pas tout.

Merci pour votre aide ce serait génial.