Textbox to update another textbox by reading a table

Hi,

I have a table (say "testtable") as below which I read into PHP:

ID............Description
1.............orange
2.............red
3.............blue

I have a form called "testform". On this are two text boxes, one called "textbox" and the other called "textanswer".

I'm trying to type a number into "textbox", get it to look up this number on the ID field of the table mentioned above and put the corresponding colour into "textanswer".

Usually I would do this by having "textbox" set up as a dropdown field and pull the second column into "textanswer" when changed. However, in this case I can't do this because if a colour is not found on the table, the user needs to be able to type in their own value in "textbox". Also, there will be some 15000 records in the table.

Can someone please show me how to set this up, if possible?

Many thanks in advance
kbitAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PranjalShahCommented:
You can still do this by having the dropdown, you need an extra value at the end as "OTHER" and if a user selects that, one blank textbox appears and then you can process the form.

0
niazz2004Commented:
find in google easy
0
kbitAuthor Commented:
I;m thinking a lazier way would be to let the user type their value in "textbox", make them press save and then PHP would do all the checking and reload the same page with or without the relevant "textanswer".

Another way would be to submit the form with the onchange of "textbox", again PHP would do the work.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kbitAuthor Commented:
Anyone in the Javascript zone have any ideas? There has to be a way of doing this without submitting through PHP!
0
kbitAuthor Commented:
No other method was found, this one is working fine
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.