Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry How do I allow users to paste html code directly into browser?

    Hello,

    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.

    Ideas?

    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

  • #2
    Regular Coder GSimpson's Avatar
    Join Date
    Aug 2006
    Location
    New Zealand
    Posts
    268
    Thanks
    9
    Thanked 0 Times in 0 Posts
    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.

    <html>
    <head>
    <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 -->
    </script>
    </head>
    <body>
    <form>
    <textarea name="htmlArea" cols=45 rows=6>
    </textarea>
    <br>
    <input type="button" value=" Preview My Page! " onclick="displayhtml(this.form)">
    </form>
    </body>
    </html>
    Please ask questions if you are unsure, we are all friends =)!!
    The internet is my Sandbox, and notepad is my Spade n' Bucket.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •