get selected value from a dropdown to use it in another dropdown: Laravel
$10-30 USD
Paid on delivery
This is an easy task for laravel programmers:
I'm using a dropdown to read a column from a database table. All i want is to get the selected value and use it to create a new query that will be populated in a new dropdown.
What i need is:
- To come out with the more efficient method and tell me why do you think that's the best way (ajax, or php only, or some laravel http request if possible)
- To edit my files to write the necessary code (will give you ftp access)
- To give me 15 minutes to answer my questions about your code.
Please only apply if you are ready to do it right now. Use codeword: "laravel09" at the beginning of your message.
Note: I'm using AdminLTE: [login to view URL]
Here is my controller:
public function selectsector() //this is the dropdown #1 that works fine
{
$sectors = DB::table('Sectors')->whereBetween('SectorID', [1, 10])->value('SectorID');
return view('besttradesview', ['sectors10' => $sectors]);
}
public function selectsubsector() //dropdown #2 not working
{
$subsectors = DB::table('Sectors')->where('parentid', $sectors)->get(); //this line is not working it does not recognize $sector variable
return view('besttradesview', ['subsectors42' => $subsectors]);
}
View:
<form method="GET">
<div class="selectsector">
<Select class="selectsector" name = "sector">
@foreach($sectors10 as $sector)
<option>{{ $sector->SectorName }}</option>
@endforeach
</select>
<div class="selectsubsector">
<Select class="selectsubsector" name = "subsector">
@foreach($subsectors42 as $subsector)
<option>{{ $subsector->SectorName }}</option>
@endforeach
</select>
</form>
Routes:
Route::get('kitysoftware/besttrades', 'SectorsController@selectsector');
Route::get('kitysoftware/besttrades', 'SectorsController@selectsubsector');
Project ID: #18263679
About the project
15 freelancers are bidding on average $35 for this job
laravel09, Hi let me do the needful for you, ready to start and look forward to hear from you and work with you...thanks!
Hi there, I am Senior Laravel developer. I will use axis or ajax to load data in another drop down while selecting drop down . Let's discuss with me more. Thanks
Dear Hiring Manager, We can help you in the project. To show once dropdown value into another after selection of value in one dropdown. I am good in: php, codeigniter, laravel, jquery, google map api, MySQL. L More
Hey? How are you? I have reviewed "get selected value from a dropdown to use it in another dropdown: Laravel" .I have good skills for these (HTML, Javascript, Laravel, MySQL, PHP). I have been working for 7 yrs in t More
Hi I have gone through the requirements. Will do this select dropdown. I'm available to start now. Please share additional details. Regards, Mohan
Hi sir, I'm readed your requirement, i can help you fix list bugs. I'm expert PHP, Wordpress, JQuery, Laravel, Codeigniter , Angularjs, Nodejs etc
Hello there,,, i have a ready made code for this type of dependent dropdown in laravel .feel free to contact
If you want to do it as mvc pattern and orm then hire me Relevant Skills and Experience Laravel, php, rest API, query builder,
laravel09 . Web application : Laravel 5, Jquery, Ajax, bootsrap. I have experience with same project (dropdown Chapitre ---> dropdown question) with simple request ajax on change $(get){.... };