Laravel Dynamic Dependent Dropdown using Ajax

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 77

  • @bigcato5840
    @bigcato5840 5 лет назад +22

    i'm quite annoyed by the voice. but great stuff, thanks..

  • @maliqnorman5539
    @maliqnorman5539 5 лет назад +6

    sir, just follow up question.. is this the best way to approach dynamic dependent dropdown? specially on country state city situation? how bout the relationship type like each has its own table.. table country, table state, table city and connect them using relationships.. please i need ur opinion on this since im a newbie..

  • @sarandatech4322
    @sarandatech4322 5 лет назад +2

    how to use two tables using same method (dependent dropdown) country in one table and state in another table

  • @keyurvala2489
    @keyurvala2489 2 года назад

    is there any tutorial for getting selected dropdown value from the database using ajax in edit functionality?

  • @rahim3070
    @rahim3070 6 лет назад +1

    This video is very good for one db table. But, if db table are multiple, then what can I do. Please reply me with a good suggestions.
    Best Regards

    • @braintricker_soft
      @braintricker_soft 4 года назад +1

      just use country id to query in state and state id to query in city table everything is same

  • @tinkerbell6834
    @tinkerbell6834 3 года назад

    Thanks for your time and efforts it helped me a lot

  • @nandalals9441
    @nandalals9441 6 лет назад +1

    Hi sir, Please make more video on laravel and ajax CRUD with full form elements includes input type file

  • @olayemiolaribigbe3333
    @olayemiolaribigbe3333 4 года назад +1

    thanks for the tutorial, please state data and city is not loading when the country option is selected from my end, it just remain blank, any help ?

  • @m.abubakarkhan4451
    @m.abubakarkhan4451 Год назад

    This code work well on single value , but not working on multiple select value plz guide me

  • @smartowlgraphics4374
    @smartowlgraphics4374 3 года назад

    I want to change dropdown list colour scheme to blue to green. Is any way? can you please guide me?

  • @murleeyadav7800
    @murleeyadav7800 6 лет назад +1

    This video is awesome..
    Can you please tell me what is the use of _token variable in this video

    • @rogeriopicilli5545
      @rogeriopicilli5545 4 года назад +1

      This is for protection. This prevent the CSRF attack

  • @Kahanikiduniya5
    @Kahanikiduniya5 4 года назад

    what if we want to select multiple country then show their state together

  • @aashiq_hasnat
    @aashiq_hasnat 4 года назад

    sometimes you just need the concept ... I made that with Vue js. Thanks

  • @NanoRdz1976
    @NanoRdz1976 5 лет назад

    Hi, thanks for sharing this video, I want to see if you can help me, I have only two dropdowns for state and city. The values of the city dropdown are loaded correctly, but if there is some validation that is not fulfilled in the form, for example a field not captured, the city dropdown loses the elements that had been previously loaded.
    Thank you in advance if you could guide me

  • @nabeeltahir6013
    @nabeeltahir6013 6 лет назад +1

    Please make more video on laravel and ajax

  • @livresonltc9754
    @livresonltc9754 6 лет назад +1

    Hi Thanks for the tut. But for some reason, I can get it work. I'm getting error in the console: POST 127.0.0.1:8000/dynamic_dependent/fetch 500 (Internal Server Error) jquery.min.js:4. Any idea? I tried multiple projects with different machines with same result. I'm using WAMP Server.

    • @trapkick5570
      @trapkick5570 4 года назад +1

      have exactly the same issue. exept for: jquery.min.js:2
      Did You solve this?

    • @mysteriousmsn
      @mysteriousmsn 4 года назад +1

      public function dynamicDropdown() {
      $countrylist = DB::table('dynamicdropdown')->select('Country')->groupBy('Country')->get();
      return view('dynamicdropdown')->with('countrylist', $countrylist);
      }


      function fetch(Request $request)
      {
      $select = $request->get('select');
      $value = $request->get('value');
      $dependent = $request->get('dependent');
      $data = DB::table('dynamicdropdown')
      ->where($select, $value)
      ->select($dependent)
      ->groupBy($dependent)
      ->get();
      $output = 'Select '.ucfirst($dependent).'';
      foreach($data as $row)
      {
      $output .= ''.$row->$dependent.'';
      }
      echo $output;
      }
      Change like this and it will work, you have to use select method, i was getting this error today and fixed and killed my 2 hrs.

    • @tinkerbell6834
      @tinkerbell6834 3 года назад +1

      @@mysteriousmsn You are a life saver thanks so much

    • @mysteriousmsn
      @mysteriousmsn 3 года назад +1

      @@tinkerbell6834 You are Welcome.

  • @rahulkrishna7810
    @rahulkrishna7810 3 года назад

    thanks for that code 😁 but the voice irritates more more 😪its not clear ...
    once again thanks for code

  • @ferdyhananto6279
    @ferdyhananto6279 3 года назад +1

    I follow this code but it cannot show data on dropdown dependent,any one help?

  • @jhanhm
    @jhanhm 6 лет назад

    Thanks Weblesson for sharing knowledge

  • @luisfernandogonzaleztostad1294
    @luisfernandogonzaleztostad1294 4 года назад

    Hello groupBy('country') method is throwing this error "SQLSTATE[42000]: Syntax error or access violation: 1055 'testing.country_state_city.id' isn't in GROUP BY (SQL: select * from `country_state_city` group by `country`)" Any idea?

  • @mysteriousmsn
    @mysteriousmsn 4 года назад

    WHOEVER IS GETTING SERVER ERROR TRY TO IMPLEMENT LIKE BELOW, ALL YOU HAVE TO DO IS TO USE "SELECT" METHOD IN THE QUERY BUILDER FUNCTIONS
    public function dynamicDropdown() {
    $countrylist = DB::table('dynamicdropdown')->select('Country')->groupBy('Country')->get();
    return view('dynamicdropdown')->with('countrylist', $countrylist);
    }


    function fetch(Request $request)
    {
    $select = $request->get('select');
    $value = $request->get('value');
    $dependent = $request->get('dependent');
    $data = DB::table('dynamicdropdown')
    ->where($select, $value)
    ->select($dependent)
    ->groupBy($dependent)
    ->get();
    $output = 'Select '.ucfirst($dependent).'';
    foreach($data as $row)
    {
    $output .= ''.$row->$dependent.'';
    }
    echo $output;
    }

  • @samoilenko_roman
    @samoilenko_roman 5 лет назад +2

    good! But all in one table...

  • @nabeeltahir6013
    @nabeeltahir6013 6 лет назад

    Make video on laravel ajax filter using checkbox and start rating .
    Laravel ajax comment system

  • @ashwinishahapurkar7478
    @ashwinishahapurkar7478 6 лет назад

    How to submit this data from select boxes into new table of database??

    • @AliRazaiamaliraza
      @AliRazaiamaliraza 6 лет назад

      ruclips.net/video/yIs_Y5adAYU/видео.html
      Watch this.

  • @khoadoo5505
    @khoadoo5505 5 лет назад

    thanks Webslesson, this help me alot.

  • @bennyuntung3706
    @bennyuntung3706 4 года назад

    source code can't download
    please repair link

  • @belongersgaming8046
    @belongersgaming8046 4 года назад

    pdate config/database.php
    set:
    'mysql' => [
    'strict' => false,
    ],
    instead of:
    'mysql' => [
    'strict' => true,
    ],
    after doing this, the error will disappeared

  • @icrmsoftware59
    @icrmsoftware59 5 лет назад +1

    Best tutorial

  • @spreddy23
    @spreddy23 6 лет назад

    groupby clause on Oracle having issues ORA-00979: not a GROUP BY expression.Did anyone have the same issue.Any help is much appreciated.

    • @djohnoliver
      @djohnoliver 5 лет назад

      hey there , I am having the same problem have you fixed yours ????

  • @kmsohelrana8246
    @kmsohelrana8246 6 лет назад

    wow what a great job.thank you very much

  • @MDFARUK-il8pw
    @MDFARUK-il8pw 6 лет назад

    please make more tutorial we will be pleased

  • @armanhossain9936
    @armanhossain9936 6 лет назад

    this source code link can't work can you help me pls

    • @bushramustofa2135
      @bushramustofa2135 6 лет назад

      Arman i think the source code is correct check that
      1. He didn't create controller as usual but it is only DynamicDependent.php
      2. Be sure you write correctly in web.php Don't forget first one is GET method and second one is POST

  • @heyyy4987
    @heyyy4987 6 лет назад

    I wanna see in vue.js. Nice. Tanks

  • @alinoori6931
    @alinoori6931 4 года назад

    it's very very very help me! I love you !

  • @animanoir
    @animanoir 6 лет назад

    Great stuff my friend, thank you.

  • @devenderkumar2761
    @devenderkumar2761 5 лет назад

    Hello Sir, Nice Video. lease Insert All These Dropdown Values In database Using Laravel . Make A Video Otherwise Add This With register Page.

  • @seekeralert9267
    @seekeralert9267 4 года назад

    the database structure isn't good not normalize and can cause a problem for the future use

  • @uristmsk
    @uristmsk 5 лет назад +2

    thx, it's very help me! cool code!

  • @nabeeltahir6013
    @nabeeltahir6013 6 лет назад

    Thank you very much sir

  • @rahulkrishna7810
    @rahulkrishna7810 3 года назад +1

    next try to put with a original voice ..

  • @MDFARUK-il8pw
    @MDFARUK-il8pw 6 лет назад

    you are the web boss

  • @osvaldobanze1845
    @osvaldobanze1845 5 лет назад +1

    Obrigado!!

  • @k3logics925
    @k3logics925 6 лет назад +1

    You forgot to make ajax more secure in controller's action

    • @k3logics925
      @k3logics925 6 лет назад +1

      if($request->ajax()){ //ajax code }

  • @SuperMakoto13
    @SuperMakoto13 6 лет назад

    Awesome video, thanks for the lesson!

  • @bushramustofa2135
    @bushramustofa2135 6 лет назад

    Thanks team weblesson

  • @napchannel2703
    @napchannel2703 4 года назад

    mantab slurrrr

  • @237camerpreneur8
    @237camerpreneur8 5 лет назад

    very nice

  • @infiappsolution
    @infiappsolution 6 месяцев назад

  • @sangeeth810
    @sangeeth810 4 года назад

    great stuff

  • @cocoiron4475
    @cocoiron4475 4 года назад

    i like this

  • @LOMBOist
    @LOMBOist 5 лет назад +1

    Why that voice ?

  • @mdnazimuddin5211
    @mdnazimuddin5211 6 лет назад

    thanks

  • @jessierhanculubong6242
    @jessierhanculubong6242 4 года назад +1

    Nothing happened 🤤😢😥😭

  • @infiappsolution
    @infiappsolution 6 месяцев назад

    hiiiiiiii

  • @farahzainodin7593
    @farahzainodin7593 4 года назад +1

    i hate the voice but great job

  • @carlahdiesto2481
    @carlahdiesto2481 3 года назад

    mali ang froeach

  • @IphoneUser27
    @IphoneUser27 3 года назад

    I wasted my time on something that doesn't work -.-