recuperation de donnees d'un formulaire
Bonjour amis JavaScripteurs,
Après avoir tourné en rond je passe demander un peu d'aide :
impossible d'afficher mes noms de villes dans ma page de résultats
:calim2:
le script suivant ne fait qu'afficher un gestionnaire de décalage horaire suivant la ville sélectionnée.
je récupère bien l'ID sélectionné, mais impossible d'afficher le nom de la ville (en dehors du menu déroulant) ...
Code:
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
|
<table border="0" cellspacing="0" cellpadding="3" style="background-color: #bd0f1e; color: #efe8c9; text-align: center;" >
<form name="where" id="where">
<tr>
<td width="100%">
<p style="font:bold 16px Arial;">Select your Office</p>
</td>
</tr>
<tr>
<td width="100%">
<select name="city" size="1" onchange="updateclock(this);">
<!-- <option value="" selected>Select your office</option> -->
<option value="4">Abu Dhabi</option>
<option value="1">Algiers</option>
<option value="8">Beijing</option>
<option value="1">Belgrade</option>
<option value="1">Brussels</option>
<option value="2">Bucharest</option>
</select>
<input type="checkbox" name="b24" value="1" id="b24"><label for="b24">AM/PM</label>
</td>
</tr>
<tr>
<td width="100%">
<script language="JavaScript">
alert(where.city.options.selectedIndex +1)
if (document.all||document.getElementById)
document.write('<span id="worldclock" style="font:bold 16px Arial;"></span>')
zone=0;
isitlocal=true;
ampm='';
function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}
function WorldClock(){
now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
hr2 = hr;
ampm="";
statusampm="";
if (document.getElementById('b24').checked){
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;
ampm = (hr > 11)?"PM":"AM";
statusampm = ampm.toLowerCase();
}
if (hr2<10) hr2="0"+hr2
var finaltime=hr2+':'+((mins < 10)?"0"+mins:mins)+':'+((secs < 10)?"0"+secs:secs)+' '+statusampm;
if (document.all)
worldclock.innerHTML=finaltime
else if (document.getElementById)
document.getElementById("worldclock").innerHTML=finaltime
else if (document.layers){
document.worldclockns.document.worldclockns2.document.write(finaltime)
document.worldclockns.document.worldclockns2.document.close()
}
setTimeout('WorldClock()',1000);
}
window.onload=WorldClock
//-->
</script>
<ilayer id="worldclockns" width=100% height=35><layer id="worldclockns2" width=100% height=35 left=0 top=0 style="font:bold 16px Arial; background-color: #bd0f1e;"></layer></ilayer>
</td>
</form>
</tr>
</table> |
quun aurait-il une idée?
Merci =)