Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

lnsfalsim's avatar

Dependent Dropdown

Hello guys! I'm trying to create a dependent dropdown on country, state and city. It's running, but only after I've changed the country, does it carry the states. I wanted it already loaded the country linked to the user, which is stored in the database, its state and city, when the page loads. And then he can make the switch if he wishes. My html: <form method="post&qu

lnsfalsim's avatar
lnsfalsim's avatar lnsfalsim8yrs agoLaravel
4
1
Last reply by lnsfalsim 8yrs ago
SUPERNOVA's avatar

Dropdown dependent

I am building a application where the user will select districts and then choose the villages. after user selecting a distric, village list displayed ! My problem is a list of villages can not be displayed maybe I wrong in ajax, If anyones find the solution, I hope will help to get the solution. images : http://www.awesomescreenshot.com/image/1921416/042bfba084ddde31895f806c194

SUPERNOVA's avatar
SUPERNOVA's avatar SUPERNOVA9yrs agoEloquent
10
1
Last reply by SUPERNOVA 9yrs ago
dmytroshved's avatar

Problem with 2 level dependent dropdown in Livewire 3

I have a problem with my 2 level dependent dropdown. Dropdown at the page: https://i.ibb.co/d4PBYFcz/5904325373724837675.jpg After I enter data into the selectors, I am taken to another page, but after returning to the previous page, my component appears to be broken The problem is that when I go back from recipes.blade.php (2nd page) to index.blade.php (1st page) my component

dmytroshved's avatar
dmytroshved's avatar Dmytro_Shv...1yr agoLivewire
12
1
Last reply by Dmytro_Shved 1yr ago
LaCoder's avatar

Dependent dropdown, send request as dropdown change

Hello, I am using Livewire and below is a dependent dropdown, <div class="col-md-6 col-lg-6 col-xl-6 col-xxl-3 mb-md-5 mb-xl-1"> <div class="d-flex align-items-center gap-2 gap-lg-3"> <select class="form-select form-select-sm form-select-solid" wire:model.live="selectedSymbol"

LaCoder's avatar
LaCoder's avatar LaCoder2yrs agoLivewire
0
1
hook's avatar

Unable to Load AJAX Data to Dynamic Dependent Dropdown

I make a program to check shipping cost and used a dynamix dependent dropdown to retrieve province_id and city_id.AJAX successfully retrieved the data from the server, but when I tried to display the data on the selectbox, no change occurred. I have tried several ways to add data into the selectbox but still no change. Here's my code Controller : public function getProvince(){

hook's avatar
hook's avatar gych2yrs agoLaravel
8
4
Last reply by gych 2yrs ago
lemonotype's avatar

Livewire 4-level dependent dropdown not working reliably.

Hello, I'm very new to it all and am trying to set up a four level dependent dropdown. I followed a tutorial for a three level dropdown and also checked the code in every other tutorial I found on these dropdowns (few and far between) but they all looked roughly the same. I have two main issues: When using orderBy('name') on get() query, it works fine the first time around but

lemonotype's avatar
lemonotype's avatar lemonotype2yrs agoLivewire
3
1
Last reply by lemonotype 2yrs ago
Marlowe's avatar

Dependent Dropdown ajax display data with the where clauses

Using the Dependent dropdown in ajax how can I only display data in a dropdown with the column names like for example when I select a program I want to display the first period only data with its column has name with 1st Period same as the 2nd period and 3rd Period only display their own specific data with the column names Example: where i used this line of code $firstPeriod =

Marlowe's avatar
Marlowe's avatar Marlowe3yrs agoJavaScript
1
1
Last reply by Marlowe 3yrs ago
Marlowe's avatar

Dependent dropdown using ajax how to display the name instead of its id

I'm trying to save both the program and subject to a student table but it only saves its id how can i change it to their names instead of id register-student.blade.php <h5 class="mt-5 lead">Programs & Subjects</h5> <div class="col mt-4 mb-3"> <div class="col"> <div class="form-outline form-line"

Marlowe's avatar
Marlowe's avatar Marlowe3yrs agoLaravel
0
1
joneyspark's avatar

Add/Delete dynamic row using Livewire with dependent dropdown

Hi, I'm using Livewire to build a Dependent cascading Dropdown with dynamic new row and delete row. I'm now able to add new row but I'm asking how I can get the Dropdown selected individual item list. When I select the first Dropdown it changes all the values the same as selected in livewire. https://i.stack.imgur.com/lsRaQ.png /project/resources/views/livewire/device-sale.blad

joneyspark's avatar
joneyspark's avatar joneyspark3yrs agoLivewire
0
1
Brammah's avatar

Dynamic Dependent Dropdown: Livewire

Hi Laracasts Community, I need some help. I have never used dependent dropdowns but I am open to learning. I have a form with different departments that are selected by a normal select input. When I select let's say, the accounts department on the select, another input (multi-select to be precise) should appear and list all members who belong to that department so that I may sh

Brammah's avatar
Brammah's avatar Brammah3yrs agoLivewire
11
1
Last reply by Brammah 3yrs ago
FounderStartup's avatar

Dependent dropdown not working ....

I have a LOCALITY dropdown dependent on a CITY dropdown...... its not working .... Any help ? blade : <div class="row"> <div class="col-sm-6 col-md-6"> <div class="form-group"> <label cla

FounderStartup's avatar
FounderStartup's avatar FounderSta...3yrs agoLaravel
3
1
Last reply by FounderStartup 3yrs ago
master_admin's avatar

Dependent Dropdown Help.

Hello, I am a beginner at laravel and followed some tutorials and created something, but I need some help regarding finalising it, I created a flow where sections have many years > years have many months > months have many days so at the time of days, create / edit I am not able to find which month I am selecting because I called all months inside the dropdown, so I found

master_admin's avatar
master_admin's avatar master_adm...4yrs agoLaravel
10
1
Last reply by master_admin 4yrs ago
Nicho's avatar

Laravel : dependent dropdown

Hello I'm currently developing a website using laravel And i'm trying to create this feature, dependent dropdown So i got 2 categories The 1st category contains brand of motorcycle: Honda Yamaha Kawasaki Suzuki And the 2nd category contains the motorcycle name from each of the motorcycle brand : Honda has : Supra X Supra X 125 Tromol Yamaha has : JUPITER JUPITER Z Kawasaki has

Nicho's avatar
Nicho's avatar vincent150...4yrs agoLaravel
1
3
Last reply by vincent15000 4yrs ago
shiro_'s avatar

PHP dependent dropdown based on file columns

Hi, i have a dependent dropdown. When you select county, you get the constituency and when you select the constituency you get the ward. I am able to get the constituency from the county but i get an error Notice: Undefined index: Please choose a constituency in C:\xampp\htdocs\ramani_dsl\lidepot\dropdown.php on line 44 {"county":["MOMBASA","KWALE"

shiro_'s avatar
shiro_'s avatar shiro_4yrs agoPHP
0
1
jcc5018's avatar

How to get the reverse of a dependent dropdown when editing a child model

So, I have a dependent dropdown used in a lot of places on my site that allows to define country->division(state)->city made in livewire. This works great when going downwards, But i have found when trying to edit the city, the state and country values are no longer present and I'm not entirely sure how to rectify this, as by default, the state value is null until a count

jcc5018's avatar
jcc5018's avatar jcc50184yrs agoLivewire
4
1
Last reply by jcc5018 4yrs ago
david001's avatar

Laravel jquery dependent dropdown hardcode

Is it possible to make dynamic dropdown with jquery and hardcoded laravel code. I have country in array and based on country index I want to show state in dropdown. This data are in file, they are not in database. ``` <select name ="country" id="country> foreach ([ 'Canada', 'UK', 'USA'] as $index => $value) { <option value

david001's avatar
david001's avatar Yassen Say...4yrs agoLaravel
7
1
Last reply by Yassen Sayed 4yrs ago
hilmi's avatar

How to Create Dynamic Dependent Dropdown in Laravel?

How to Create Dynamic Dependent Dropdown in Laravel 8 ? basically, I want to show program data in dropdown based on selected mode. With the code that I've made below, I can already display program data in the dropdown when I select mode 1 or active online. But when I select mode 2 or Full Hybrid, the data in the dropdown doesn't appear. Route Route::post('/programs', function

hilmi's avatar
hilmi's avatar hilmi4yrs agoLaravel
3
1
Last reply by hilmi 4yrs ago
Ahmed96's avatar

How to Implement Dynamic Dependent Dropdown Using Laravel and inertia js

Hello From the topic name, my question is how do I make a child drop-down list, for example, I have a table of sub-sections linked to the table of departments. I want when I click on the name of the department it shows its sub-sections via laravel + inertia js with vue3

Ahmed96's avatar
Ahmed96's avatar paravecdes...3yrs agoGeneral
8
1
Last reply by paravecdesign 3yrs ago
Laracast13's avatar

laravel dependent dropdown check

Hi Have dependent dropdown which return data. ajax have three values and when all of them is set it gives result. But I need add check, when a, b , c all this value is set send ajax request , now it send if one of them is set. I need do this check, in jQuery on in controller. In controller I try check with $a_id != null && $b_id != null && $c_id != null

Laracast13's avatar
Laracast13's avatar MarianoMor...5yrs agoMix
1
1
Last reply by MarianoMoreyra 5yrs ago
lilo's avatar

Choosing Multiple Data From Dependent Dropdown

Hi, I have a form. In this form, I have 3 fields. These are location, number and camera number. Each number and camera no has a location. In the form,I have done a dependent dropdown for number and camera no. When user selects a location, only the numbers and camera numbers which have relation to this location are seen on the menu. My problem is when user selects more than one

lilo's avatar
lilo's avatar lilo5yrs agoLaravel
0
1
Armani's avatar

Dependent dropdown in continuous form

Hello there I know how to create dependent dropdown using Laravel and Vuejs but my project has a page that is like parent-child form. It is like this, first dropdown is Product and the second one is Brand. For example in Product we have Tire and Battery, and in Brand we have brands of Tire or Battery. So user can add as many rows as he wants in child form therefore when user se

Armani's avatar
Armani's avatar Armani5yrs agoLaravel
2
1
Last reply by Armani 5yrs ago
vandan's avatar

dependent dropdown not working on edit data

hello i have data like dependent dropdown when i click to 'alert_level' then fetch automatically location field data but in edit on data its does not work supppose i have 2 field alert level and location when i click to alert level data then display location dropdown automatically in same edit time alert level data selected and also location dropdown data selected so how to do

vandan's avatar
vandan's avatar vandan5yrs agoLaravel
0
1
maaz's avatar

Dynamic Dependent dropdown error

Hey everyone, i have a list of countries and states, when someone click on a country it will show the related states of that country. here is my code route Route::get('/getStates/{id}', 'StateController@getStates')->name('getStates'); StateController.php public function getStates($id) { $states = State::where('country_id', $id)->pluck('name', 'id');

maaz's avatar
maaz's avatar maaz5yrs agoLaravel
0
1
noblemfd's avatar

Laravel dependent dropdown for update loads all the states by default

In my Laravel-5.8, I am using dependent dropdown for country and corresponding states. For the create view blade, I have this: public function getStateList(Request $request) { $states = DB::table("config_states") ->where("country_id",$request->country_id) ->pluck("state_name","id")

noblemfd's avatar
noblemfd's avatar noblemfd5yrs agoLaravel
0
1
dbnames's avatar

Dependent Dropdown With API

I'm trying to get data from API to be displayed in Dropdown List, even though the parent Dropdown is displaying the data, the rest of the Dropdown List doesn't show anything when i select a data from parent Dropdown. Here is my Script: <script type="text/javascript"> $('#province').change(function(){ var provinceID = $(this).val(); if(provinceID){

dbnames's avatar
dbnames's avatar frankielee5yrs agoLaravel
16
1
Last reply by frankielee 5yrs ago
noblemfd's avatar

Dependent Dropdown Error: GET http://localhost:8888/get.employee.states?country_id=5 404 (Not Found)

In Laravel-5.8, I'm trying to load state from a selected country. The HrEmployeesController is in a folder called Hr Controller class HrEmployeesController extends Controller { public function getStateList(Request $request) { $states = DB::table("config_states") ->where("country_id",$request->country_id) ->plu

noblemfd's avatar
noblemfd's avatar noblemfd6yrs agoLaravel
2
1
Last reply by noblemfd 6yrs ago
Kanchan186's avatar

how to set validation on dynamic dependent dropdown

when i select industry dropdown then shows validation to segment dropdown view <form class="m-t-40" method="post" action="{{url('/')}}/brand" enctype="multipart/form-data" novalidate> {{csrf_field()}} <div class="form-group">

Kanchan186's avatar
Kanchan186's avatar piljac16yrs agoLaravel
2
1
Last reply by piljac1 6yrs ago
lewanay's avatar

Dependent dropdown using ajax in laravel

Hello :) I have a dropdown for students_id. Now I want to track the student name and class from another table when someone select any student id. I did something for that using ajax. Its not showing me any error in the console but just giving me null array and I think thats the problem related to the query. You can check my code below. :) I have a dropdown for students_id. Now

lewanay's avatar
lewanay's avatar lewanay7yrs agoLaravel
2
1
Last reply by lewanay 7yrs ago
mihirpatel83's avatar

Dependent Dropdown After Validation

Hello, I have a parent dropdown and when parent is selected, I populate 3 child dropdown using ajax. Now those child dropdown are also required fields. But before i select them and i validate the form, the child dropdown are populating blank. So how can i get the old value of parent dropdown in Controller action so that I can populate those dependent child dropdowns after valid

mihirpatel83's avatar
mihirpatel83's avatar manojow7yrs agoLaravel
5
1
Last reply by manojow 7yrs ago
aurawindsurfing's avatar

Nova Dependent Filter - Dependent Dropdown

HI! Did anyone figure out how to make dependent dropdown options based on a value of some other field while creating a model? Lets say we select Country first, then we want dropdown to show us only Cities in a given country. Thanks!

aurawindsurfing's avatar
aurawindsurfing's avatar aurawindsu...7yrs agoNova
4
1
Last reply by aurawindsurfing 7yrs ago
mousumi_mou's avatar

Laravel Dependent Dropdown with Ajax

I Need a Cascading Dropdown for my admin panel, where the dropdown values come from database. [[ example: https://prnt.sc/lccqc4 ]] I need to be work like this: https://prnt.sc/lccq7o When I select Route no, the values of other dropdown will show related pickpoint names of that selected route. This is my ajax code I have written in php file (app-admin.blade.php): $(document).r

mousumi_mou's avatar
mousumi_mou's avatar mousumi_mo...7yrs agoLaravel
4
1
Last reply by mousumi_mou 7yrs ago
mousumi_mou's avatar

Dependent Dropdown Using Laravel / Ajax

I Need a Cascading Dropdown for my admin panel, where the dropdown values come from database. [[ example: https://prnt.sc/lccqc4 ]] I need to be work like this: https://prnt.sc/lccq7o When I select Route no, the values of other dropdown will show related pickpoint names of that selected route. This is my ajax code I have written in php file (layout.admin.blade.php): <script&

mousumi_mou's avatar
mousumi_mou's avatar jlrdw7yrs agoLaravel
1
1
Last reply by jlrdw 7yrs ago
angelina98's avatar

Dependent dropdown from same table

Please help me to make Dependent dropdown from same table with Laravel 5

angelina98's avatar
angelina98's avatar Tray27yrs agoLaravel
3
1
Last reply by Tray2 7yrs ago
SUPERNOVA's avatar

Eloquent dropdown dependent

I worked one week for this project, but until now I have not been able to resolve. I am confused :( I want to create a dropdown dependent then displays the data into the table. I have a problem in ajax, in the browser console "SyntaxError: missing (before the formal parameter. I hope someone can help me, thanks a lot :D view : {!!Form::open(array('url'=>'', 'files'=>

SUPERNOVA's avatar
SUPERNOVA's avatar SUPERNOVA9yrs agoEloquent
2
1
Last reply by SUPERNOVA 9yrs ago
DarkSpirit's avatar

Subcategory Dependent Dropdown with a Custom PageUrl

I am trying to load subcategory dependent dropdown with the AJAX script on a custom {pageUrl}. For example, I have a custom page {pageUrl} which is called Dadobot. I encounter a problem trying to pass a current page (i.e. Dadobot) to my routes.php by using AJAX script. View.php <div class="form-group"> <label for="description">Category <

DarkSpirit's avatar
DarkSpirit's avatar DarkSpirit9yrs agoLaravel
1
1
Last reply by DarkSpirit 9yrs ago
DarkSpirit's avatar

How to Retrieve a Value from Json Dependent Dropdown (Laravel 5.2)

I have a problem with getting a value from a dependent dropdown (state which is dependent on a country). Country: (A list of countries) State: (List out the country's states depending on the country selection) I always get ""inputState" => "+stateObj.id +" as a value from dd($request->input('inputState')) when I submitted the form which is obvious

DarkSpirit's avatar
DarkSpirit's avatar DarkSpirit9yrs agoLaravel
0
1
joyjas77's avatar

Dependent dropdown menus

A while ago I asked a similar question and had a couple of responses one has got me a bit closer but I'm still struggling with an issue. routes.php Route::get('/getStreets', function($id) { return Street::whereSuburb($id)->get(); }); Street.php (Model) public static function whereSuburb($id){ return DB::table('streets') ->select('streetName', 'id')

joyjas77's avatar
joyjas77's avatar joyjas7711yrs agoTips
0
1
Laracast13's avatar

Livewire3 Dependent Dropdown

Hi In Livewire3, "Select Country" it don't send request to updatedSelectedCountry and don't updating $cities class DependentDropdown extends Component { public $countries; public $states; public $cities; public $selectedCountry; public $selectedState; public function mount() { $this->countries = Country::all(); } publ

Laracast13's avatar
Laracast13's avatar fabyo1yr agoLivewire
1
1
Last reply by fabyo 1yr ago
Khalid475's avatar

dependent dropdown list

iam getting the error in console : jquery.min.js:5722 GET http://127.0.0.1:8000/ShippingPrices/1 404 (Not Found) send @ jquery.min.js:5722 ajax @ jquery.min.js:5383 (anonymous) @ ShippingPrices:503 dispatch @ jquery.min.js:2763 v.handle @ jquery.min.js:2647 handleMouseUp_ @ unknown i would like to get Cities belong to selected Country and i have tried the following code: in

Khalid475's avatar
Khalid475's avatar Khalid4753yrs agoLaravel
10
1
Last reply by Khalid475 3yrs ago
peterpan26's avatar

laravel 8 select2 dependent dropdown

hello, i'm trying to save on database the name (origem) but it's saving the id instead... //create.blade <div class="container mt-5"> <div class="row"> <div class="form-group mb-3"> <select class="origem form-control

peterpan26's avatar
peterpan26's avatar peterpan263yrs agoLaravel
1
1
Last reply by peterpan26 3yrs ago
rubenochoa's avatar

Undefined $variable creating dependent dropdown bookable activity

Project: bookable activity Error: Undefined variable $days Description: creating mini-eshop which you can choose if you want to go for riding, doing arts or do guided tour. User have to choose 3 of the activities by choosing time and day which are inserted manually at database managment. web.php //use db; Route::get('product.index','ProductController@getDates'); Route::get('pr

rubenochoa's avatar
rubenochoa's avatar rubenochoa3yrs agoLaravel
12
1
Last reply by rubenochoa 3yrs ago
Constantine_92's avatar

ajax jquery when i click addnewfield dependent dropdown not working . not data coming or changing

//here my blade <div > <label for="field" class="font-weight-bold">Διάλεξε Ειδικοτητα και κατηγορια μελετητων </label> <div id="dynamic-field-1" class="form-group row dynamic-field" > <div class="col-sm-4"> <select class="form-con

Constantine_92's avatar
Constantine_92's avatar Sinnbeck4yrs agoJavaScript
11
1
Last reply by Sinnbeck 4yrs ago
Constantine_92's avatar

hi Dropdown dependent with ajax!

Hi i try to associated 3 models 1)Specialities 2)Surveys 3)Works Each specialities have many surveys that can declaration . That mean that each surveys have many same specialities_id (how i do that without duplicated rows? ) After each surveys belong to specific work

Constantine_92's avatar
Constantine_92's avatar Constantin...4yrs agoLaravel
10
1
Last reply by Constantine_92 4yrs ago
hira4472's avatar

Dynamically Dependent Drop-Down Lists Without AJAX & JQUERY

I'm not getting where I'm doing mistake in joining and establishing logic that when I selected the specific product from first drop down then it would show only categories of that selected product on second drop down?? public function index(Request $request) { $productdetail=productdetail::all(); $data=new productdetail(); $data=new productdetail()

hira4472's avatar
hira4472's avatar hira44726yrs agoLaravel
4
1
Last reply by hira4472 6yrs ago
zaster's avatar

Dependent Dropdown - Jquery - Ajax

A customer can be assigned to many companies. Therefore when the customer is selected the respective companies should appear. Instead of the company names, i am getting the company_ids How can i get the company names JobController.php public function edit(Job $job) { $subJobs = $job->sub_jobs; $customers = User::all(); $selectedCustomer = $job->

zaster's avatar
zaster's avatar zaster7yrs agoCode Review
4
1
Last reply by zaster 7yrs ago
Vikrant's avatar

dependent dropdown does not work

error : jquery-1.12.4.js:10254 GET http://localhost/getStateList/12 404 (Not Found) here my controller : public function register() { $country = DB::table("countries")->pluck("c_name","id"); return view('Recruiter.RecruiterRegistration',compact('country')); } public function getStateList($id) { $state =

Vikrant's avatar
Vikrant's avatar Vikrant8yrs agoLaravel
0
1
AlanOsta's avatar

Dependent / Cascade Dropdown using Vue3 + Vuetify (composition API) and Axios

Hi I'm tying to create simple dependent dropdown using Vue3 + Vuetify using Axios but when response arrives rerender of the v-select component is not happening. Some explanation on the expected behavior: The first dropdown renders a list of soccer matches (partidos) which are passed from the controller thru IntertiaJS. Once the match is selectd it should fetch a list of people

AlanOsta's avatar
AlanOsta's avatar AlanOsta1yr agoVue
1
1
Last reply by AlanOsta 1yr ago
jcc5018's avatar

Filament dependent dropdowns not displaying the old record

I am trying to get a dependent dropdown to display correctly for my article type categories. This set up current displays the correct child category for the chosen parent category, and saves a record in the database, but when I refresh, that record is not populated, and updating creates a new record instead of updating the existing category. An article can only have one categor

jcc5018's avatar
jcc5018's avatar jcc50181yr agoFilament
2
1
Last reply by jcc5018 1yr ago
yaseera2000's avatar

Independent dropdown

Hi, I want to create a independent dropdown using ajax, I tried using onchange, onclick, onfocus, events but nothing seems to work. I've searched alot on this but all the solutions are on dynamic dependent dropdown. but i want a solution that displays data when I click on dropdown. Any suggestion/help would be appreciated. Thanks.

yaseera2000's avatar
yaseera2000's avatar jlrdw3yrs agoLaravel
1
1
Last reply by jlrdw 3yrs ago
maaz's avatar

Dynamic Dependent Drop down box not working using ajax in laravel .

i was looking for a dynamic dependent dropdown selectbox, so i found a video i copy the code line by line from him but my code is not working idk why. here is my MainController.php <?php namespace App\Http\Controllers; use App\State; use App\Country; use Illuminate\Http\Request; class MainController extends Controller { public function index() { $countries

maaz's avatar
maaz's avatar maaz6yrs agoLaravel
19
1
Last reply by maaz 6yrs ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.