View Full Version : How do I allow users to paste html code directly into browser?

08-26-2006, 10:01 AM

I am currently working on a project that will be much like a local version of myspace. Take a peek: www.jaxspace.com...

I am using an Access DB with ASP and DW8.
I would like to allow users to store raw html code into an access table using an insert record transaction. This part works fine.

Here is my question:

How can I dynamically compile the html code (from a recordset) with a preview button? This way, users can preview their code and then I can use an update record transaction if they would like to make adjustments.


Thanks for any help, I am getting more and more grey hairs by the day on this one.

Kevin Nolan
Web Developer
Intuition Web Design

08-27-2006, 05:01 AM
Mr/Mrs WebIntuition,
I have read your post and found a script similar to what you want,
This simply previews the text area html in a new window, however with a few changes you could preview in same window or even post it however for things such as my space I do think they use php/mysql to request the pages and post on a new htm/html page.

Anyways here is a script that I found at http://www.javascript.internet.com/forms i have tidied it up ready for use.

<script language="JavaScript">
<!-- Begin
function displayhtml(form) {
var inf = form.htmlArea.value;
win = window.open(", ", 'popup', 'toolbar = yes, status = yes');
win.document.write("" + inf + "");
// End -->
<textarea name="htmlArea" cols=45 rows=6>
<input type="button" value=" Preview My Page! " onclick="displayhtml(this.form)">

Please ask questions if you are unsure, we are all friends =)!!