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.