Skip to main content
Participant
August 11, 2009
Question

Can I enter data into field and see the display output next the entry

  • August 11, 2009
  • 2 replies
  • 709 views

i want to have an input field where the user enters the information and a second box by its side where the user sees what the information would like like when it is displayed on the website

Similar to what happens on this page

http://www.facebook.com/ads/create/

Is this possible using cold fusion?

many thanks

    This topic has been closed for replies.

    2 replies

    Known Participant
    August 11, 2009

    As kunjan stated you'll need a collection of resources outside of coldfusion.

    Basically in your form elements you'll add an OnChange javascript event:

    http://www.w3schools.com/jsref/jsref_onchange.asp

    In your javascript you'll need to create, style, and set a series of <div></div> elements using a javascript function.

    Basic "untested" example:

    This gets placed in between your <head></head> tags.

    <script type="text/javascript">

    function setText(){

         document.getElementById('div1').innerHTML = document.form1.element1.value;

    }

    </script>

    Place and style the below accordingly or to your preference.

    <form name="form1">

    <input type="text" name="element1" onChange="setText();" />

    </form>

    <div id="div1"></div>

    Now this is a very basic example, you can actually create listening events and pass additional parameters but this is the basic idea. You don't have to assign the values to a div id tag - you can use any html tag that accepts an id tag. (ie. <b id="div1"></b>) 

    Most of the work will come in applying css to your elements to get it to display the way you want it.

    Hope this helps you out.

    August 11, 2009

    Hello nickandjulie,

       It is possible not in coldfusion but in any language it is part of HTML enable / disable the div tag or table.

    Get back to me if you have any problem.

    Ragards,

    Kunjan