Hi guys,
OK so here is my problem.
What I want to do is that, everytime a user clicks on a link, the value of the link gets inserted in a textarea. When the user clicks on another link, that value is on another line.
For exemple there is 3 links:
Link 1 , Link 2 , Link 3
And the users clicks on link 1 and link 3. So the texarea must show:
Link 1,
Link 3,
And if a user wants to take out a value, they have to right click on it.
For exemple, I would like to take out Link 3, so I right click link 3 in the textarea, and it doesnt show.
So far, I am able to insert the values in the textarea, but not in different lines...
It shows Link1,Link3...
Here is the Javascript Code:
And here is where the links are, which is pullen using DB:
And here is the textarea code:
Thanks for your help,
Ara
OK so here is my problem.
What I want to do is that, everytime a user clicks on a link, the value of the link gets inserted in a textarea. When the user clicks on another link, that value is on another line.
For exemple there is 3 links:
Link 1 , Link 2 , Link 3
And the users clicks on link 1 and link 3. So the texarea must show:
Link 1,
Link 3,
And if a user wants to take out a value, they have to right click on it.
For exemple, I would like to take out Link 3, so I right click link 3 in the textarea, and it doesnt show.
So far, I am able to insert the values in the textarea, but not in different lines...
It shows Link1,Link3...
Here is the Javascript Code:
Code:
<script language="javascript" type="text/javascript">
function addtext(text) {
document.players.players1.value += text+",";
}
</script>
Code:
echo"<table border='1' width='100%'>
<tr>
<td>
<table width='100%'>
<tr>
<th colspan='6' bgcolor='#444444'><font color='#FFFFFF'>$user_team</font></th>
</tr>";
$result = mysql_query("SELECT * FROM `playersratings` WHERE `Team` ='$ProId' OR `Team` = '$FarmId' ",$link);
while($row = mysql_fetch_array($result))
{
$name = "" .$row['Name']. "";
echo "<tr><td><a href='#' onclick=\"addtext('$name')\"\>$name</a></td></tr>";
}
?>
Code:
<textarea name='players1' COLS="20" ROWS="10" type="text"></textarea>
Ara
Last edited: