Quantcast
Channel: SourceCodester - Visual Basic, VB.NET, C#, PHP/MySQL, C/C++, Java/JavaScript, ASP/ASP.NET, MS Access, FoxPro, SQL
Viewing full articles (9326 articles)
Browse article index
↧

Populate Birth Date Dropdown List Using CodeIgniter

$
0
0
Submitted by: 
Language: 


In my previous post I uploaded a source code called “Populate Dropdown List Using CodeIgniter”. In that sample code, I used the country field to populate the value using the helper function.

This time, I’ll show you on how to populate a birth date field with three separate dropdown list.

Here’s the code to call the helper and populate the array with values from our function:

  1. $this->load->helper('birthdate');
  2.  
  3. $this->data['birth_date_year']= buildYearDropdown('birth_date_year',$this->input->post('birth_date_year'));
  4. $this->data['birth_date_month']= buildMonthDropdown('birth_date_month',$this->input->post('birth_date_month'));
  5. $this->data['birth_date_day']= buildDayDropdown('birth_date_day',$this->input->post('birth_date_day'));

And this is how you pass the value from the controller to the view:

  1. echo$birth_date_day;
  2. echo$birth_date_month;
  3. echo$birth_date_year;

Please see attached file.

To download the framework please visit Getting Started With CodeIgniter.



↧

Viewing full articles (9326 articles)
Browse article index

Latest Images

Trending Articles



Latest Images