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
| <!DOCTYPE html>
<head>
<title> Untitled </title>
<script type="text/javascript">
function test( obj){
// recup des info
var sTitre = obj.title;
var sValue = obj.value;
var oURL = document.getElementById('retURL');
var oNames = document.getElementById('docNames');
if( obj.checked == true){
// si vide
if( oURL.value == ""){
oURL.value = 'http://www.site.com/page.php?var=';
}
else{
oURL.value += ',';
oNames.value += ',';
}
oURL.value += sValue;
oNames.value += sTitre;
}
else{
oURL.value ='';
oNames.value ='';
}
}</script>
</head>
<body>
Doc A <input type='checkbox' id='ckb1' value='1' title="doc_a" onclick="test(this)">
Doc B <input type='checkbox' id='ckb2' value='2' title="doc_b" onclick="test(this)">
<br><input type='text' name='retURL' style="width:300px" id='retURL'>
<br><input type='text' name='docNames' style="width:300px" id='docNames'>
</body>
</html> |
Partager