...

View Full Version : Help with writing text into textareas



tannerbeck50
11-18-2010, 03:15 AM
hey guys,
im trying to write whether player 1 or 2 won into the text area.
see code below.
thanks

[CODE]
<html>
<head>
<script type="text/javascript">
var a=1

</script>
<style type="text/css">
body
{
background-image: url(http://fc08.deviantart.com/fs40/i/2009/018/f/8/FLOWJOB_3d_graffiti_by_UrbanCalligraphism.jpg);
}
h1
{
font-family:"sans-serif",tahoma;
background-repeat: no-repeat;
color:#00ffe7;
}
p
{
color:#000000;
font-family:"sans-serif",tahoma;
font-weight:900;
}
</style>
</head>
<body>
<center><h1>Ghetto Dice Project</h1></center>
</br>
</br>
</br>
</br>
</br>
</br>
<center>
<textarea rows="9" cols="18" id="textarea">
</textarea>
</center>
</br>
</br>
</br>
</br>
</br>
<center>
<table>
<tr>
<input type="text" id="playerone" size="4" value="">
<input type="text" id="playertwo" size="4" value="">
</tr>
</br>
<tr>
<button onclick="
a=(Math.floor(Math.random()*13));
document.getElementById('playerone').value=a;
">
PLAYA 1
</button>
<button onclick="
b=(Math.floor(Math.random()*13));
document.getElementById('playertwo').value=b;
">
PLAYA 2
</button>
</tr>
</table>
</script>
</br>
</br>
<p>
Hand coded with care by Tanner Beck
</p>
</center>
</body>
</html>
[CODE]

Old Pedant
11-18-2010, 06:43 AM
(1) See rule 1.5 of this forum.

(2) Ummm...since when can you roll a ZERO when you toss a pair of dice? Hmmm...maybe when the guy with the big knife catches you cheating?

(3) You don't specify *WHEN* the winner's name/whatever should appear.

(4) Why would you need 9 ROWS in a textarea to write one winner's name/whatever??

(5) HINT: You set the value of a <textarea> the same way you set the value of an <input type="text">.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum