Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to bring back value from lookup table

Participant ,
May 01, 2008 May 01, 2008
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.
894
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 01, 2008 May 01, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2008 May 01, 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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 01, 2008 May 01, 2008
What's the part that you are having trouble with?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2008 May 01, 2008
How do I return the selected value from the lookup table, back to the form, and populate the input field ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 02, 2008 May 02, 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2008 May 02, 2008
I understand how to pass the selected value back to the origianl form, as a url variable. But once it comes back to the form, how do that value to autopopulate the field (as if it was entered by the user), so that they can continue to fill out the rest of the form.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 04, 2008 May 04, 2008
quote:

Originally posted by: trojnfn
I understand how to pass the selected value back to the origianl form, as a url variable. But once it comes back to the form, how do that value to autopopulate the field (as if it was entered by the user), so that they can continue to fill out the rest of the form.


place the url variable in the field?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2008 May 04, 2008
LATEST
quote:

Originally posted by: trojnfn
I understand how to pass the selected value back to the origianl form, as a url variable. But once it comes back to the form, how do that value to autopopulate the field (as if it was entered by the user), so that they can continue to fill out the rest of the form.

cfinput has a value attribute.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources