Skip to main content
Inspiring
May 1, 2008
Question

How to bring back value from lookup table

  • May 1, 2008
  • 2 replies
  • 927 views
I have a form where the user has to enter a code. I need to verify the entry against a lookup table and if the recordcount is 0, entry is invalid and display an error message.

However, if they click on an icon next to the field, it will take them directly to the lookup table and they can search for the value. Once found, how can I bring back the value and plug it into the form field ? The lookup table is read only.
    This topic has been closed for replies.

    2 replies

    Inspiring
    May 2, 2008
    What's the part that you are having trouble with?
    trojnfnAuthor
    Inspiring
    May 2, 2008
    How do I return the selected value from the lookup table, back to the form, and populate the input field ?
    May 2, 2008
    when the user selects the option/id pass it through a form or url variable (etc), then insert that value into your input field.

    Do you understand how to do that?
    Inspiring
    May 1, 2008
    trojnfn wrote:
    > I have a form where the user has to enter a code. I need to verify the entry
    > against a lookup table and if the recordcount is 0, entry is invalid and
    > display an error message.
    >
    > However, if they click on an icon next to the field, it will take them
    > directly to the lookup table and they can search for the value. Once found, how
    > can I bring back the value and plug it into the form field ? The lookup table
    > is read only.
    >


    How do you want to do it?

    There are many ways to skin this type of requirement and a decision
    depends on many factors such as size of the look up table and how much
    you want to hide from the user.

    Just remember that the User Interface is on a client machine and the
    look up table is on the server and they are not in constant or direct
    communication with each other.

    In the past, if the look up table was small, I have just always sent it
    to the client with the rest of the form and used it to populate a form
    control of some sort for the user. Sometimes using DHTML affects for a
    better user interface.

    You can refresh the form page to make a new request to the server for
    the lookup data, rebuilding the form in the current state for the user.

    You can use frames, inline or otherwise, or a 'pop up' window to make
    this new request to the server to fetch the look up table data.

    You can use AJAX functionality to make this request behind the scenes
    and use the results returned in the response to modify the user
    interface with the lookup data.

    None of these are simple, couple of line, code examples. So you would
    need to make a decision on which one best meets the requirements and
    needs of your task and try and implement. If you have follow on
    questions you can probably ask them here.

    But note that none of my discussion really touched on ColdFusion.
    Since, at the root level, to ColdFusion a request is a request and it
    could care less how it received it. But the latest versions of CF do
    have some tools to aid a developer with some of these types of interfaces.
    trojnfnAuthor
    Inspiring
    May 2, 2008
    If they find what they are looking for in the lookup table, then I want them to click on that value and then it should return them to the original form and plug that value into the field. (if possible)