![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
14/10/2009, 10:19
|
![Avatar de ceSharp](http://static.forosdelweb.com/customavatars/avatar269155_2.gif) | | | Fecha de Ingreso: octubre-2008 Ubicación: Madrid
Mensajes: 495
Antigüedad: 16 años, 3 meses Puntos: 66 | |
Respuesta: email ... hay algunas variables que tienen acento... debería de funcionar (es que estaba probando códigos con acento y se me ha colado...) si quieres por si acaso cópiate esto mejor
-------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function rellenaTextBox()
{
var texto = '';
var ch1 = document.getElementById('ch1');
var ch2 = document.getElementById('ch2');
var ch3 = document.getElementById('ch3');
if(ch1.checked)
texto += ch1.value + ';';
if(ch2.checked)
texto += ch2.value + ';';
if(ch3.checked)
texto += ch3.value + ';';
document.getElementById('tx_box').value = texto;
}
</script>
</head>
<body>
<div>
<input id="ch1" onclick="rellenaTextBox();" type="checkbox" value="uno" />uno<br />
<input id="ch2" onclick="rellenaTextBox();" type="checkbox" value="dos" />dos<br />
<input id="ch3" onclick="rellenaTextBox();" type="checkbox" value="tres" />tres<br />
<input type="text" style="width:300px" id="tx_box" />
</div>
</body>
</html>
------------------------------------------ |