Get Id

Hi guys.

I’m creating a form for a product, where one of the inputs are the id of the company that distributes it. This form will be submitted by users, and the company will already be in the database table “tbl_Company”. Of course the user don’t know the id of the company, so he/she should be able to just write the name of the company, and the application will then recognize the name, and use the id of that name instead. How do i achieve this?

Hello

Do you mean it will be a free text field? Or do you plan to provide the users with some kind of select / autocomplete input?

autocomplete

Hi, this ext should help you with that:

http://www.yiiframework.com/extension/select2

Have a nice day

user this extesnion

http://www.yiiframework.com/extension/yiiselect2/

demo

http://ivaynberg.github.io/select2/