Cjuiautocomplete Input Box

Hello,

I want to force user to select from auto complete list only.

Thanks,

I think you can use this




array('readonly'=>$model->scenario == '/*your action*/')



if not pls post your code.

Setting inputs read only is not enough for force user to select from list.

Put some server side validation and check if submitted data match to data you are displaying in autocomplete box.

if there’s limited data options, you should consider using listbox,

another approach is using hidden field to save certain value come from the server when user selecting autocomplete value (can be data id or some hash), by default the field should be empty (also empty the value when user cancel selection), you can check on submit whether the hidden field is empty and cancel submit.