Necesito pasar un numero a binario y dejarlo en otro textbox
Necesito pasar un numero a binario y dejarlo en el otro ... Textbox .. La funcion no me pesca ...
que puede ser ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>pasar</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<CENTER></CENTER>
<P>
<SCRIPT language=JavaScript>
function passText() {
var num1 = document.pass.hid.value;
if(num1 == 'three') {
document.pass.one.value = document.pass.three.value
document.pass.three.value = ""
document.pass.hid.value = "one"
}
else {
document.pass.three.value = document.pass.one.value
document.pass.one.value = ""
document.pass.hid.value = "three"
}
}
FUNCTION CONVIERTE_A_BINARIO(NUMERO){
CONST TABLABIN ="0000000100100011010001010110011110001001101010111100110111101111"
DIM X, TEMPORAL
TEMPORAL = ""
FOR X = 1 TO LEN(NUMERO)
TEMPORAL = TEMPORAL + MID(TABLABIN, (VAL("&H" + MID$(NUMERO$, X, 1) - 1) * 4 + 1, 4)
NEXT
return TEMPORAL
END FUNCTION
</SCRIPT>
<FORM name=pass>
<INPUT onchange="document.pass.hid.value='one'; return true" name=one><BR>
<INPUT onclick=passText() type=button value=pasar><BR>
<INPUT type=hidden name=hid>
<INPUT onchange="document.pass.hid.value='three'; return true" name=three>
</FORM></FONT></P></BODY></HTML>
que puede ser ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>pasar</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<CENTER></CENTER>
<P>
<SCRIPT language=JavaScript>
function passText() {
var num1 = document.pass.hid.value;
if(num1 == 'three') {
document.pass.one.value = document.pass.three.value
document.pass.three.value = ""
document.pass.hid.value = "one"
}
else {
document.pass.three.value = document.pass.one.value
document.pass.one.value = ""
document.pass.hid.value = "three"
}
}
FUNCTION CONVIERTE_A_BINARIO(NUMERO){
CONST TABLABIN ="0000000100100011010001010110011110001001101010111100110111101111"
DIM X, TEMPORAL
TEMPORAL = ""
FOR X = 1 TO LEN(NUMERO)
TEMPORAL = TEMPORAL + MID(TABLABIN, (VAL("&H" + MID$(NUMERO$, X, 1) - 1) * 4 + 1, 4)
NEXT
return TEMPORAL
END FUNCTION
</SCRIPT>
<FORM name=pass>
<INPUT onchange="document.pass.hid.value='one'; return true" name=one><BR>
<INPUT onclick=passText() type=button value=pasar><BR>
<INPUT type=hidden name=hid>
<INPUT onchange="document.pass.hid.value='three'; return true" name=three>
</FORM></FONT></P></BODY></HTML>
1 respuesta
Respuesta de admoreno
1