API Questions on Kentico API.
Version 5.x > API > auto populate fields base on the selection in BizForm View modes: 
User avatar
Member
Member
wtzeng-micro-datanet - 9/1/2011 3:15:58 PM
   
auto populate fields base on the selection in BizForm
hi
I created a bizform with one Drop-down list, which I use SQL query to create the list. and few text box. i want to do is once the user made the selection of drop-down list and the form will auto populate the data info text boxes.
Ex: the drop - down list is from the customer table and the user will select the customer ID then the form will auto populate the name, phone, email... into the text boxes.

Could you point me to right documentation?

thanks

Wei

User avatar
Member
Member
kentico_michal - 9/2/2011 1:45:32 AM
   
RE:auto populate fields base on the selection in BizForm
Hello,

Regrettably, this is not possible to accomplish. You will need to create a custom form control that could contain a drop-down list control with AutoPostback property set to true.

When user changes the selected item, you can access other fields in the BizForm by getting their reference like this:

TextBox txtBox = (TextBox) Form.FieldControls["productprice"];

and change their properies depending on the selected item.

For more information about developing form controls can be found here: Developing form controls


Best regards,
Michal Legen