在页面中的任何验证失败后,多选不保留值

I have a form in my application with a multi select. I'm using CI's form helper to build my forms, so the build of the element looks like this:

form_multiselect('company_name[]',$show_company, set_value('company_name'),'id="company_name" class="form-control" required '  );

My problem is that after filling the form whenever any validation fails my selected value get refreshed.

How to get the value selected even if any validation fails in that page.

Please use this instead of using your code ::

form_multiselect('company_name[]',$show_company, set_select('company_name'),'id="company_name" class="form-control" required '  );