Thursday, September 20, 2018
AliDropship is the best solution for drop shipping

Suppose you are building a Registration form in which users want to select a city to lives in. For that you need to populate respected state that person lives in, otherwise the city field will be extremely long (and there is more of a chance for user mistake and mystification). To solve this problem we need to create dynamic needy dropdowns. In order to accomplish this using Code Igniter, this is what I did:

Html view form dropdownpopulate.php

Now I will create database table for state and cities dropdown populate.

This code was put into a code igniter view file called “dropdownpopulate.php”.
Now we add form open and closing form tags, and looks to a controller.
Here in the controller we will create a function to load the view file.
To load the states dropdown, we need to create model function get_state_info() to load the states information to controller file named as “ektree.php”.

Here I used JavaScript on select function to load city dropdown
In script I posted the state value to controller and print the out to html view file.

Now I will create model functions to get the state and cities details.

Thanks for reading this article.
Download

AliDropship is the best solution for drop shipping
Tags: , ,
I am Saritha Reddy, a Remote codeigniter,Angularjs Developer. I have 4+ years of strong experience in designing, implementing, Programming and delivering advanced XAMPP ( Apache, MySQL and PHP) Web applications development. I am an Indian national and based Andhra Pradesh,Hyderabad. In addition to providing custom programming and design, I also have extensive experience with Open Source technologies to keep costs down and get websites running with as little fuss and wait as possible.

1 Comment

Shafeer Khan March 31, 2018 at 4:55 am

Using Function form_dropdown() in Codeigniter is More Easier

Controller

$CurrencyList=$this->MasterModel->GetDataDropDownByCondition(“tbl_currency”,”currencyId”,”currencyId,currencyName,currencySymbol”,$condition,”currencyName ASC”);//Getiing List as Array

$this->data[“CurrencyList”][“”] =label(‘SelectCurrency’) ;// “Select Currency “;
if ($CurrencyList)
{
foreach ($CurrencyList as $type)
{
//Parsed To Array
$this->data[“CurrencyList”][$type[“currencyId”]] = $type[“currencyName”].”( “.$type[“currencySymbol”].” )”;
}
}
$this->data[“CurrencyListDrop”] = ‘id=”currencyId” class=”form-control require show-tick” key=”NNN” emsg=”‘.label(‘Currency’).'” data-live-search=”true” “‘; //Attributes To DropDowns

View

1st Parameter — Name Of Dropdown
2nd Parameter -Array Contains Details
3rd- if any value need to be default selected that one
4th-Attributes

Leave a Comment