#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Baltimore, MD
    Posts
    12
    Rep Power
    0

    remove record BUT NOT from database


    I have a database driven application called Production Calendar. It has the following fields: id, name, review_date and live_date. When a user fills out the live_date field for the project that's been done I want it (the project) to disappear from the page BUT NOT from the database. Please help me with the code!
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    Victoria, you're asking the same question that you asked here. And again, this has nothing to do with ColdFusion. This is a CSS/DHTML issue.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Washington, DC
    Posts
    5
    Rep Power
    0
    Obviously, you posted the same question here because you didn't like or understand the other answers. To get a better answer, though, you need to post a better question. Please tell us EXACTLY how you want your page to work.

    For example, (1) you say your application has certain fields. That is not very clear. Perhaps you are talking specifically about a FORM on a WEB PAGE. Is that right?

    (2) Your description of what happens when a user fills out the live_date field is unclear and incomplete. Exactly when do you want the record to "disappear"? That is, the record disappears in response to some action or event. What action is that? When the user types the first character in the field? When the clicks away from the field? When the users presses some button?

    (3) I suspect that your description of #2 above is incomplete in another way: Why does the user need to "fill out the field"? You didn't say what you are going to do with the data he provides. If you just want the field to disappear, why does the user have to fill it out?

    So you really need to put yourself in our shoes and explain what you are doing. We aren't mind readers.

    Here is an example that might be similar to what you want to say to us:

    I have a form that displays a list of projects that are open, one project per line. The purpose of the form is to allow the user to enter the dates of project completion (for those projects that have been completed). There is separate date-completed field for each project. In order to make the page less cluttered, I want the line containing the project information (including the date field) to disappear from the screen when the user enters a valid date and the date field loses focus. I don't want to lose the date because I want to post that date to the database when the user submits the form, but I want it to disappear so it's easy for the user to see what projects are still open.

    I that what you want? If so, the answer is that you will have to learn DHTML. You will probably have to use layers, JavaScript, and hide/show 'commands" within the browser.

    One more thing. Is this really a good idea? What is the purpose of making the record disappear? Is it really helpful to the user or is it more of a gimmick? What happens if the user changes his mind and wants to NOT mark a project completed after he has already done so. He won't be able to see the record or change his data. I might be a WHOLE lot better to forget about making the record disappear and instead just let the user submit the form. Upon submission, the database is updated and the the same page is immediately re-drawn with only the incomplete projects showing. This way, the clutter is removed but user remains in control.
    Last edited by flowcontrol; February 2nd, 2004 at 05:31 PM.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Buffalo, NY
    Posts
    156
    Rep Power
    12
    Just my $.02 but I do one of two things:

    add a binary "view" or "status" field to the table with the default of 1. (1 being view or on and 0 being no-view or off).

    Once the live date is entered, change the status field from 1 to 0 and change your select statement to say,

    SELECT *
    FROM my_table
    WHERE status = 1

    -OR-

    change your select statement to retrieve only the data that doesn't have a live_date.

    SELECT *
    FROM my_table
    WHERE live_date = ''

    By filtering out data you don't want to display at the query level, you are putting less load on your SQL server, less data is being transmitted back to your web server and less data has to be downloaded from the web server, resulting in faster page loads.

    -Matt
    http://www.gotspy.com
    Forget Milk!
    Gotspy?

    www.gotspy.com

IMN logo majestic logo threadwatch logo seochat tools logo