|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Insert Link</title>
<link href="EditorStyle.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function setText()
{
var sel = document.getElementById('selType');
var txt = document.getElementById('txtLink');
txt.value= sel.options[sel.selectedIndex].value;
}
function returnLink()
{
var linkTxt = document.getElementById('txtLink').value;
var dispTxt = document.getElementById('txtDisplay').value;
var lnkTarget = document.getElementById("selTarget").value;
if(linkTxt == "" || linkTxt == "http://" || linkTxt == "https://" || linkTxt == "ftp://" || linkTxt == "news://" || linkTxt == "mailto://")
alert("Please enter a valid Link");
else if(dispTxt == "")
alert("Please enter a Display Text");
else
{
var lnkTxt = "<a href=\"" + linkTxt + "\" target='"+ lnkTarget +"'>" + dispTxt + "</a>";
window.close();
returnValue= lnkTxt;
}
}
</script>
</head>
<body bgcolor='#fffcd1' topmargin="0" leftmargin="0" >
<div align="center">
<table class='txtstyle3' bgcolor='#fffcd1'>
<tr>
<td colspan='2' align='center'>
CREATE LINK
</td>
</tr>
<tr>
<td colspan='2' align='center'>
Type: <select id='selType' class='txtstyle3' onchange='setText()'>
<option value='http://' selected>HTTP</option>
<option value='https://'>HTTPS</option>
<option value='ftp://'>FTP</option>
<option value='news://'>News</option>
<option value='mailto:'>Email</option>
</select>
Target: <select id='selTarget' class='txtstyle3'>
<option value='_blank' selected>Blank</option>
<option value='_self'>Self</option>
<option value='_top'>Top</option>
<option value='_parent'>Parent</option>
</select>
</td>
</tr>
<tr>
<td align="left">
URL:
</td>
<td>
<input type='text' style='width: 250px' class="txtstyle3" id='txtLink' value='http://' />
</td>
</tr>
<tr>
<td align="left">
Display Text:
</td>
<td>
<input type='text' style='width: 250px' class="txtstyle3" id='txtDisplay' />
</td>
</tr>
<tr>
<td colspan='2' align='right'>
<button id='btnOK' class='buttonStyle2' onclick='returnLink()'>
OK</button>
<button id='btnCancel' class='buttonStyle2' onclick="window.close()">
Cancel</button>
</td>
</tr>
</table>
</div>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.