Guest Evandro Felipe Posted October 31, 2003 Report Share Posted October 31, 2003 Caros amigos,Como fazer com que o checked fique true ao digitar e o style="background-color: do script abaixo fique da cor digita e não o formulario todo?Desde já agradeco a ajuda.Evandro Felipe.<html><head><script language=javascript>function gerarcor(formulario) { document.bgColor=document.formulario.valorcor.value;document.formulario.V12.checked.value=true;}</script><title>Cor do texto</title></head><body><form name=formulario method=post><table border="1" cellpadding="0" width="100%" bordercolor="#000000"> <tr> <td width="1%"> <p align="center"><font size="1" face="Verdana"><input type="radio" value="V12" name="R1">Minha cor:</font><br> <font size="1" face="Verdana"><input type="text" name="valorcor" onKeyUp='return gerarcor(this)' size="9"></font></td> <td width="23%"> <p align="center"><font size="1" face="Verdana"><input type="text" name="ccor" size="4" style="background-color: document.formulario.valorcor.value"></font></td> </tr></table><table border="0" cellpadding="0" width="100%"> <tr> <td width="100%"> <p align="left"><font size="1" face="Verdana">No campo minha cor, digite números para gerar sua cor.</font></td> </tr></table></form></body></html> Quote Link to comment Share on other sites More sharing options...
0 efelipe Posted November 3, 2003 Report Share Posted November 3, 2003 Por favor, podem me ajudar?.... Quote Link to comment Share on other sites More sharing options...
0 Miqui Posted November 4, 2003 Report Share Posted November 4, 2003 aqui esta o erro Evandrodocument.formulario.V12.checked.value=true;o correto é document.formulario.R1.checked.value=true;de acordo com o seu formulário... Quote Link to comment Share on other sites More sharing options...
Question
Guest Evandro Felipe
Caros amigos,
Como fazer com que o checked fique true ao digitar e o style="background-color: do script abaixo fique da cor digita e não o formulario todo?
Desde já agradeco a ajuda.
Evandro Felipe.
<html>
<head>
<script language=javascript>
function gerarcor(formulario) {
document.bgColor=document.formulario.valorcor.value;
document.formulario.V12.checked.value=true;
}
</script>
<title>Cor do texto</title>
</head>
<body>
<form name=formulario method=post>
<table border="1" cellpadding="0" width="100%" bordercolor="#000000">
<tr>
<td width="1%">
<p align="center"><font size="1" face="Verdana"><input type="radio" value="V12" name="R1">Minha
cor:</font><br>
<font size="1" face="Verdana"><input type="text" name="valorcor" onKeyUp='return gerarcor(this)' size="9"></font></td>
<td width="23%">
<p align="center"><font size="1" face="Verdana"><input type="text" name="ccor" size="4" style="background-color: document.formulario.valorcor.value"></font></td>
</tr>
</table>
<table border="0" cellpadding="0" width="100%">
<tr>
<td width="100%">
<p align="left"><font size="1" face="Verdana">No campo minha cor, digite
números para gerar sua cor.</font></td>
</tr>
</table>
</form>
</body>
</html>
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.