B
Blue Streak
Hello,
I am trying to develop an interface to view an internal knowledge base. One feature I would like to add is a "Generate E-Mail" button which would automatically open an e-mail message a populate it with the title and the article from the knowledge base. Each KBase item contains a title and article where the article contains HTML formatting. So far, I have used a client-side JavaScript block to perform this task along with an HTML control.
i.e.
<INPUT onclick=GenerateEMail() type=button value="Generate E-mail" name=btnEmail />
....
function GenerateEMail()
{
oDiv = document.all.pnlArticle;
oDiv.contentEditable = 'true';
if (oDiv.innerHTML != '')
{
subject = escape(document.frmKBase.lstTitle.options[document.frmKBase.lstTitle.selectedIndex].text);
var controlRange;
if (document.body.createControlRange)
{
controlRange = document.body.createControlRange();
controlRange.addElement(oDiv);
controlRange.execCommand('Copy');
oWin = window.open('mailto:[email protected]?subject='+ subject);
}
oDiv.contentEditable = 'false';
}
else
{
alert('Please select an article!');
}
I use the copy command to the clipboard so that the HTML formatting is not lost. The problem with this method is that you need to perform a paste when the e-mail message window opens up.
Is there a way to have the article pasted automatically?
Is there a way of doing this all in ASP.NET?
TIA...
I am trying to develop an interface to view an internal knowledge base. One feature I would like to add is a "Generate E-Mail" button which would automatically open an e-mail message a populate it with the title and the article from the knowledge base. Each KBase item contains a title and article where the article contains HTML formatting. So far, I have used a client-side JavaScript block to perform this task along with an HTML control.
i.e.
<INPUT onclick=GenerateEMail() type=button value="Generate E-mail" name=btnEmail />
....
function GenerateEMail()
{
oDiv = document.all.pnlArticle;
oDiv.contentEditable = 'true';
if (oDiv.innerHTML != '')
{
subject = escape(document.frmKBase.lstTitle.options[document.frmKBase.lstTitle.selectedIndex].text);
var controlRange;
if (document.body.createControlRange)
{
controlRange = document.body.createControlRange();
controlRange.addElement(oDiv);
controlRange.execCommand('Copy');
oWin = window.open('mailto:[email protected]?subject='+ subject);
}
oDiv.contentEditable = 'false';
}
else
{
alert('Please select an article!');
}
I use the copy command to the clipboard so that the HTML formatting is not lost. The problem with this method is that you need to perform a paste when the e-mail message window opens up.
Is there a way to have the article pasted automatically?
Is there a way of doing this all in ASP.NET?
TIA...