combo box |
Hello,
Can anyone help me find the right code to input combo box through model? I think I should change role input text into some other codes since it is a combo box that I am trying to input into the database. PHP Code: 'role' => $this->input->post('email') controllers/cpages.php PHP Code: public function addusers() { views/addusers.php PHP Code: <tr> models/Mpages.php PHP Code: public function add_user()
" If I looks more intelligence please increase my reputation."
Maybe read the CodeIgniter Users Guide on the Form Helper form_dropdown()
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-09-2016, 05:32 AM)InsiteFX Wrote: Maybe read the CodeIgniter Users Guide on the Form Helper form_dropdown() Yes, I already read the user guide but do not know how to fix the model. models/Mpages.php PHP Code: public function add_user() I should change the role into something else since it is a dropdown box. PHP Code: 'role' => $this->input->post('email')
" If I looks more intelligence please increase my reputation."
This is my revision but I still get strange result:
PHP Code: public function add_user() username email password role user [email protected] 12345678 <select name="roles"
" If I looks more intelligence please increase my reputation."
You have not read the docs! Clearly.
http://www.codeigniter.com/user_guide/he...m_dropdown Why would you put the output of form_dropdown function into an array with input posts that you then insert into your database!!!!! I seriously do not know whether to laugh or cry! This will tell you how dropdowns work http://www.html-form-guide.com/php-form/...elect.html Now you have a post field with your dropdown option value. Access it just like you would any other input post. The form helper just helps you to write your select HTML a bit more easily than writing it all out. Did you say you were building an eCommerce CMS? OMFG :-( |
Welcome Guest, Not a member yet? Register Sign In |