1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <SCRIPT language=javascript>
var chaine="19,5-20-88Euralis";
chaine=chaine.replace(/[^\d,-]+/g,'');
var reg=/-+/g;
var NPK=chaine.split(reg);
for (var i=0; i<NPK.length; i++) {
var newinput= document.createElement("input");
newinput.setAttribute('type','text');
newinput.setAttribute('name','N'+i);
newinput.setAttribute('readonly','readonly');
newinput.setAttribute('value','+ NPK[i] +');
newinput.setAttribute('size', '10');
newinput.setAttribute('onKeyUp', 'Calculer()');
<!--document.body.appendChild(newinput)-->
document.getElementById('NPK_id').appendChild(newinput)
}
</SCRIPT>
<div id="NPK_id"></div> |
Partager