Click to See Complete Forum and Search --> : link in textarea - pint in it for you


dkenny
02-19-2003, 02:20 PM
Hi guys.

In the code below I want say, "Banana", to be clickable so the user can click on it and banana.html will open in a new window.

Can this be done or as anyone got a better script?

Thanks all in advance

<HTML><head>
<script language = "javascript">

//

qList = new Array();
qList[0] = ["Do you like Mangoes?", 1, 2];
qList[1] = ["Then go and buy Mangoes.", 0, 0];
qList[2] = ["How about Bananas?", 3, 4];
qList[3] = ["You're a monkey!", 0, 0];
qList[4] = ["Go, Starve to death", 0, 0];
curQ = 0;


function askQuestion(i) {
curQ = i;
form1.question.value = qList[i][0];
if (qList[i][1] == 0) {
// you can put your ending functions here
}
}

function showYes() {
askQuestion(qList[curQ][1]);
}

function showNo() {
askQuestion(qList[curQ][2]);
}


///
</script>
</head>
<body onload="askQuestion(0)">
<form name = "form1">
<textarea name = "question" cols = 50 rows = 3 onchange = "validate()"></textarea>
<input type = "button" name = "yesButton" value = "YES" onclick = "showYes();">
<input type = "button" name = "noButton" value = "NO" onclick = "showNo();">
</form>
</body>
</HTML>

pyro
02-19-2003, 02:42 PM
You can not have links in textareas. Here's how I'd do what you are trying to do...

dkenny
02-19-2003, 02:47 PM
You my friend are an absolute star - made me a very happy man.

Take care mate 10/10