Auto updatable text box

Discussion in 'Programming' started by balleyne, Feb 20, 2009.

  1. #1
    I have users entering data in a form. When a certain number of fields are populated I wish for a window to appear that displays all the items of information entered (which would indicate one complete record has been added).

    Any suggestions as to how this can be accomplished?
     
    balleyne, Feb 20, 2009 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could probably achieve something like that using javascript and one of the form field events like onKeyUp event. When the event is triggered check the number of fields populated. If they equal a complete record, create a cfdiv to display the information Though that won't work if javascript is disabled.

    But can I ask why? In other words, why not just indicate the number of fields required and provide a button to click when finished. Then validate the information when the button(s) are clicked.

    Just trying to understand the goal and the most user friendly way to achieve it.
     
    cfStarlight, Feb 21, 2009 IP
  3. balleyne

    balleyne Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry for my extremely delayed response. The reason I wish to use this feature is to provide a way for users to see the data that they have already entered *on the fly*. The number of records being entered is normally numerous and users tend to "tab" thru the fields rapidly while entering data, I just want a way for them to see all the records they inserted, on the same form they are using, as the record is successfully entered.
     
    balleyne, Feb 26, 2009 IP
  4. balleyne

    balleyne Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I should have mentioned earlier also that I'm using Coldfusion 7 Mx, I don't think that the cfdiv tag is available in this version. Any other suggestion would be gratly appreciated.
     
    balleyne, Feb 27, 2009 IP
  5. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No, it is not available in MX7. But it's just a basic <div> tag, with some extra features. So you could just use a plain <div> with some simple javascript to write dynamic content or hide/show the <div>

    You can hide/show an element using the object's style:
    document.getElementById(theID).style.display = 'none'; //hide
    document.getElementById(theID).style.display = 'block'; //show

    To write content you can either use the innerHTML property or the DOM method
    http://www.w3schools.com/JS/js_obj_htmldom.asp
    http://oreilly.com/pub/a/javascript/synd/2001/08/17/DOM-2.html
     
    cfStarlight, Feb 27, 2009 IP