T
TonnyD
I need to use a prompt to insert links into a text area in frontpage
to allow it to be user friendly. I have come up with the following
script which i have pieced together from other discussions. The only
problem is I cant get it to work. I was able to stop all the errors
but now the information will not post in the text area. Im definitely
new with this and I am not sure what to do next.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>title</title>
</head>
<script language="JavaScript">
function insertUrl()
{
var url = prompt("Enter the complete URL for the hyperlink",
'http://');
var label = prompt("Enter the title of the website", "website");
if (url && label)
document.form1.short_story.value += '<a href="'+url+'">'+label+'</a>';
}
</script>
<form action="add.php" name="form1" method="POST" onsubmit="return
check_fields()">
<textarea name="short_story" rows="4" cols="95" style="font-family:
Tahoma; font-size: 8pt; font-weight:bold">
</textarea>
<input type="button" id=short_story value="Click to Insert Link"
onClick="insertUrl()">
<input type="hidden" name="dosend" value="yes">
</table>
</form>
</br>
</body>
</html>
to allow it to be user friendly. I have come up with the following
script which i have pieced together from other discussions. The only
problem is I cant get it to work. I was able to stop all the errors
but now the information will not post in the text area. Im definitely
new with this and I am not sure what to do next.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>title</title>
</head>
<script language="JavaScript">
function insertUrl()
{
var url = prompt("Enter the complete URL for the hyperlink",
'http://');
var label = prompt("Enter the title of the website", "website");
if (url && label)
document.form1.short_story.value += '<a href="'+url+'">'+label+'</a>';
}
</script>
<form action="add.php" name="form1" method="POST" onsubmit="return
check_fields()">
<textarea name="short_story" rows="4" cols="95" style="font-family:
Tahoma; font-size: 8pt; font-weight:bold">
</textarea>
<input type="button" id=short_story value="Click to Insert Link"
onClick="insertUrl()">
<input type="hidden" name="dosend" value="yes">
</table>
</form>
</br>
</body>
</html>