PDA

View Full Version : Form field database lookup



catapult
3 Sep 2010, 12:37 AM
Hi all,

Iím after a bit of general thought and any ideas for a project I am undertaking. Iíve been asked to develop an ordering system which is to manage customers, products and the usual associated bits and pieces.

One of the requirements is for a customer lookup feature when completing the order forms. Iíve seen on some sites the feature where you start typing into a field and after about 3 characters it pops up a list of possible options, this is what Iíve been asked to achieve but instead of just one field I need to populate the whole customer section of the form. Basically, if the customer is already in the database fetch the details otherwise save the new customer details.

My initial thoughts are to do something with a combobox on the surname but I know there is probably a better solution, I just canít think what.

All ideas and suggestions gratefully received.

Thanks in advance

Condor
3 Sep 2010, 12:43 AM
Correct, use a combobox like this one (http://dev.sencha.com/deploy/dev/examples/form/forum-search.html) and update the form in the select or blur event of the combobox.

catapult
3 Sep 2010, 12:56 AM
Cheers mate! Once again you have just what I need, do you ever sleep?

I'll give it a go and see what I get.

catapult
3 Sep 2010, 7:44 AM
I have played with the code and have it working. I was just wondering if it is possible to change the number of characters entered before firing off the search? At the moment it defaults to four and I haven't found anything to tell me where or if I can change it.

Condor
3 Sep 2010, 9:36 PM
So you missed the 'minChars' config option?

catapult
6 Sep 2010, 12:32 AM
Eak! Yes. It was Friday afternoon. I'd had a long week. To busy thinking about that first beer. Waffle, waffle... :">

Cheers mate.