htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Internal links from a database >> easy :-)


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Mikesplace
New User

Dec 7, 2004, 3:06 AM

Post #1 of 1 (5584 views)
Shortcut
Internal links from a database >> easy :-) Can't Post

This uses ASP and an Access database with fields: ID(autonumber) pagename(text) precis(text) pagetext(memo)
I populate a select box with value=ID and text to display=pagename
So here we go...
Rename "link.html" to "link.asp"
In "htmlarea.js" change "link.html" to "link.asp"
In "link.asp" after the end of the table and before the buttons put a select box and populate it with the file ID and pagenames from your database.
Your page will be called something different to "display_page.asp"

<!-- this line will populate the URL box with the users selection -->
<select size="5" onchange="f_href.value=this.options[this.selectedIndex].value">
<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("mydata.mdb")

Set rsRecords = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT ID,pagename FROM tblPages ORDER BY pagename ASC;"
rsRecords.Open strSQL, adoCon
Do While NOT rsRecords.EOF

response.write "<option value=display_page.asp?id=" & rsRecords("ID") & ">" & rsRecords("pagename") & "</option>" & vbCrLf

rsRecords.MoveNext
Loop
rsRecords.Close
Set rsRecords = Nothing
adoCon.Close
Set adoCon = Nothing
%>
</select>

Now... how hard was that?
Enjoy

 
 
 


Search for (options)