Click to See Complete Forum and Search --> : Auto fill out


thuyduong
11-06-2003, 12:39 PM
Hi all,
I created a perl form to collect data in a flat text file and it work great.
1. Date
2. Part Number
3. Description
4. Quantity
5. Comment

But if I have a part number and a list
501-1234-01 Desk
501-2345-02 Chair
501-4567-01 Book
501-9876-02 Pen

will javascript can write to add in this html form, so if people add part number 501-1234-XX it will auto fill in Description is Desk, or 501-2345-XX and it will auto fill in Chair, so we only add Quantity and Comment ? it will advoid of mistyping or force poeple to type or select on description.

I saw the script if you add the zip code then it auto fill in the state, it is cool so i think someone can do this and will you show me the code.

Thanks for your help

Khalid Ali
11-06-2003, 01:48 PM
yes its pretty simple to get this done really,
just asign an onkeyup event call to the textfield in question and use a function that will check whats the value in the field...depending upon the value just show the description somewhere on the page

thuyduong
11-06-2003, 02:18 PM
Hi Ai,

How do you that ? Could you show me the code ?
Thanks for your help.:)