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
| <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title>test</title>
<script language="JavaScript" type="text/javascript">
function setFormOrganisation(id_form,organisation,class_name,table_class_name)
{
var obj_form = document.getElementById(id_form);
var id_zone_msg = 'sform_zone_msg_' + id_form;
var cote = organisation.toLowerCase();
if (!class_name) class_name = 'zone_msg_form';
if (!table_class_name) table_class_name = 'table_msg_form';
var new_ul = document.createElement('ul');
new_ul.setAttribute('className',class_name);
new_ul.setAttribute('id',id_zone_msg);
new_ul.appendChild(document.createTextNode('Messages : '));
if (cote == 'top') obj_form.insertBefore(new_ul,obj_form.firstChild);
if (cote == 'bottom') obj_form.appendChild(new_ul);
if (cote == 'right' || cote == 'left')
{
var next = obj_form.nextSibling;
var parent = obj_form.parentNode;
var new_td_msg = document.createElement('td');
var new_td_frm = document.createElement('td');
var new_table = document.createElement('table');
new_table.setAttribute('className',table_class_name);
new_td_msg.appendChild(new_ul);
new_td_frm.appendChild(obj_form);
new_ul.style.marginTop = '0px';
new_ul.style.paddingLeft = '15px';
if (cote == 'right')
{
new_table.appendChild(new_td_frm);
new_table.appendChild(new_td_msg);
}
else
{
new_table.appendChild(new_td_msg);
new_table.appendChild(new_td_frm);
}
parent.insertBefore(new_table,next);
}
}
</script>
</head>
<body onload="setFormOrganisation('f1','right');
document.getElementById('sform_zone_msg_f1').innerHTML = 'TEST : <li>Une Option</li><li>Une Autre Option</li>';">
<form id="f1" method="post" action="test.htm">
Login : <input type="text" maxlength="30" size="25" /><br />
Pass : <input type="text" maxlength="30" size="25" /><br />
<br />
<input type="submit" value="Envoyer" />
</form>
</body>
</html> |
Partager