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
| <HTML>
<HEAD>
<TITLE>Test</TITLE>
<style>
.cboShort {
width:80px;
}
.cboLong {
width:330px;
}
#dpComboBox {
display: none; /* Important, do not change */
position: absolute; /* Important, do not change */
color: black;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
width: 250px;
background-color: #eeeeee;
}
</style>
<script language="javascript" type="text/javascript">
var l = 0;
var t = 0;
var dest = null;
function GetCbo() {
EnsureCalendarExists();
DestroyCalendar();
if(arguments[0] == null || arguments[0] == "") {
// arguments not defined, so display error and quit
alert("ERROR: Destination control required in function call GetDate()");
return;
} else {
// copy argument
dest = arguments[0];
}
/* Calendar is displayed beside the destination element.*/
setCalendarPosition(dest);
DrawCalendar();
}
function setCalendarPosition(dest){
var cElement = dest;
var myX = cElement.offsetLeft;
var myY = cElement.offsetTop;
var pElement = cElement.offsetParent;
//Add the offset position of the current element and the position of all its parents.
while (pElement != document.body) {
myX += pElement.offsetLeft
myY += pElement.offsetTop
pElement = pElement.offsetParent
}
l = myX - 3;
t = myY + 22;
if(t < 0) t = 0;
}
function DestroyCalendar() {
var mycbo = document.getElementById("dpComboBox");
if(mycbo != null) {
mycbo.innerHTML = null;
mycbo.style.display = "none";
}
return
}
function DrawCalendar() {
DestroyCalendar();
cbo = document.getElementById("dpComboBox");
cbo.style.left = l + "px";
cbo.style.top = t + "px";
var sCbo = "<table><tr><td>" +
" <select name=\"champ2\" id=\"combo2\" size=\"4\">" +
" <option value=\"1\">MOB-001 : Combinaison de type record invalide</option>" +
" <option value=\"2\">MOB-002 : Statut-evenement invalide</option>" +
" <option value=\"3\">MOB-003 : Identifiant non trouvé</option>" +
" <option value=\"4\">MOB-004 : Impossible de trouver le tarif</option>" +
"</select></td></tr></table>";
cbo.innerHTML = sCbo; // works in FireFox, opera
cbo.style.display = "inline";
}
function EnsureCalendarExists() {
if(document.getElementById("dpComboBox") == null) {
var eCalendar = document.createElement("div");
eCalendar.setAttribute("id", "dpComboBox");
document.body.appendChild(eCalendar);
}
}
</script>
</HEAD>
<BODY>
<form method="get">
Type d'erreur :
<input type="text" name="champ1" size="7" value="MOB-001" onClick="GetCbo(this);"/>
</form>
</BODY>
</HTML> |
Partager