Laravel Dynamic Dependent Dropdown

Поделиться
HTML-код
  • Опубликовано: 1 янв 2017
  • This Tutorial you will learn, Laravel dynamic dependent dropdown using ajax, How to Make Dynamic Dependent in Laravel using Ajax. How to use Laravel with Ajax for populate dropdown Listbox with dynamic data. How to Create Dynamic Dropdown in Laravel. Dynamic Dependent Dropdown in Laravel using jQuery and Ajax. Laravel Multi Dynamic Dropdown changes from the database with Ajax. How to change one dropdown or select box depend or base on another dropdown without refreshing the page.Step by step explanation of how to change dropdown dynamically.
    Project Download link-
    gitlab.com/Bons/laravel5.3_dy...
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Let's catch up? Follow me on Social media mentioned below!
    ● Facebook: / bonstutorial…
    ● Website: www.bonstutorial.com/
    For any queries, feel free to shoot me an email
    ● bonstutorial@gmail.com
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ==============Get Updated==========================
    You don't subscribe yet then click here for getting the update
    bit.ly/bonstutorial
    =========================Related Tags=========================================
    laravel ajax,laravel,laravel drop down list from model,laravel dropdown from database,laravel 5 dropdown from database,laravel dynamic dependent dropdown using ajax,dynamic drop down,ajax dropdown,dependent drop down list using ajax,dynamic select drop down,laravel dynamic dropdown list,dependent drop down list using ajax in php,laravel vuejs dynamic dropdown,ajax drop down list
    , dynamic drop down , laravel 5.3 for beginner , bons dynamic drop down , bons , bons laravel , bons tutorial , easy dynamic change drop down , two related drop down change , select box dynamic change, dynamic laravel , text field change based on drop-down , ajax,
    ==========================================================================
    Tags:
    #LaravelDynamicDropdown #MultiDynamicDropdown #InputChanging_DependOn_AnotherInput #OneSelectOptionChange_DependOneAnother #changingInput_based_AnotherInput_fromDatabase. #laravel_dynamic_dropdown #bons #multidynamicdropdown #bonstutorials #bonsprogramming #laravel5.8 #laravel6 #bonstutorial

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

  • @bons281
    @bons281  4 года назад +2

    Hello everyone, many of you asked about voice explanation. I solved many of your problems and I found that everyone's problem is pretty much similar. Hence depending on the situations, I made a series of 3 videos links are below-
    -------------------------------------------------------------------------------------------------------------
    1st video link[ voice explanation]: ruclips.net/video/4UXs3P0Q-h0/видео.html
    2nd video link [show a technique to solve a common prob] : ruclips.net/video/hk7B3f74ZVg/видео.html
    3rd video link [show JSON data in the table]: ruclips.net/video/aPQ4v5fV_Lg/видео.html
    ----------------------------------------------------------------------------------------------------------------
    playlist link:
    ruclips.net/video/4UXs3P0Q-h0/видео.html&list=PLRuJ0hwOBGrYrBEmNuZYO5GkJ34SMjV3d&index=2&t=602s
    -----------------------------------------------------------------------------------------------------------------
    please like comment share my videos and subscribe my channel

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

    Wonderful tutorial. Love the way you take your time to make this work. Amazing

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

    Very clear and helpful. I'm just learning Laravel framework for a project and I have to make a whole website using it, you really saved my day!

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

      Thanks a lot. Best of luck for learning

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

    Nice tutorial. I needed to dynamically populate my second drop-down using data from a pivot table which made things more complicated, but your example + Google search helped me to get there.

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

      +Hirschman nice to hear that it help you.thanks a ton.

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

    It's works, I work in Laravel 5.6 , thank you!

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

    Amazing tutorial Bons, Well done..!

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

    Thank you very much bons, finally I can understand how to do this, i love the notes you put in the video, it was really helpful. Keep going, you earned a new subscriber.

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

      Glad to have you on the board @Mauricio .i have a plan to make another this topic video with audio and showing the solution of the general problem which people usually face during deploy this example in a real-life project. Be with bonstutorial

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

    Thanks, so useful. I couldn't insert the data the way you did but i used an append to an empty div and it worked. Good video.

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

      @Marcos glad to hear that you find it useful.

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

    Finally, i resolved my errors and thanks a lot !!!!!!!

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

    Lovely tutorial. It is really helpful. Thank you

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

    thanks, you save a lot of time for me .

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

    thank you so much for this wonderful tutorial. It helped me with my project a lot.

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

      great to hear that

  • @herr_pouya
    @herr_pouya 2 года назад +1

    Thanks man, that was awesome

  • @syamim3865
    @syamim3865 7 лет назад +1

    Thanks for this tutorial. Really helps me in developing my project. Keep it up. Wish u have a nice day ;)

    • @bons281
      @bons281  7 лет назад

      thanks +syamin for your nice feedback...wish u a nice day also

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

    Great Job!!!
    Thank you So much

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

    Thanks bro..
    Its help me a lot..
    A nice tutorial.

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

    Amazing Tutorial

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

    GOD DAMN. BIG THANKS FOR AUTHOR!!!

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

    Thanks, genius.i will like to know you as a person. You really amazed me. I have been doing this for the past two days now I got it right. Thanks, Bro. You are too much. I really gain so much in this tutorial. Love you

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

      thanks a ton @afolabi busari. It's my pleasure.

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

    thank you so much this is very helpful

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

    Thank you so much! made me pass my master studies. :-D

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

      Welcome +Johannes Deyringer :D.Stay tuned with bonstutorials

  • @HaiderAli-ee5kg
    @HaiderAli-ee5kg 7 лет назад +1

    Beautiful explanation bro. It was very helpful for me.

    • @bons281
      @bons281  7 лет назад +1

      its really great to hear that nice compliment.thanks +haider

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

    Thank you very much Brother for this topic i resolved my errors

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

      thanks a ton @nadil.. don't forget to subscribe my channel

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

    Thanks... last 3 days i m working on that but get proper solution for that. but this tutorial help me for achieve this work...thanks

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

      Glad to know that it work for you :D

  • @asmaulhasnat9249
    @asmaulhasnat9249 7 лет назад +3

    you are awesome .i it's really a good job .wish happy day

    • @bons281
      @bons281  7 лет назад

      +Asmaul thanks that u like that.stay tuned .

  • @codeology1
    @codeology1 7 лет назад +1

    Thanks ... awesome tut..

    • @bons281
      @bons281  7 лет назад

      thanks a ton @marvel

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

    Thank you so much

  • @muhammadmeganataadam7831
    @muhammadmeganataadam7831 7 лет назад +1

    nice tutorial bons

    • @bons281
      @bons281  7 лет назад

      thanks a lot +Adam. chuffed to bits

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

    thank you!

  • @CodeWithBamie
    @CodeWithBamie 5 месяцев назад

    hi, love the tutorial, will this also change the values in the form field?

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

    its very helpfull.
    can make one more video -> how to save(insert) that dropdown selected values in database..?
    thank you..

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

    thank you!!!!

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

    hello, great work, just wondering, how i can refresh a list of products using these drop-down as filters? cheers

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

    very useful =] thx

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

    Thanks , you save me , you got +1 Subscribe

  • @alvarosinaloa8862
    @alvarosinaloa8862 7 лет назад

    Thanks pal!!

    • @bons281
      @bons281  7 лет назад

      so glad...thanks

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

    Thanks

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

    Merci beaucoup

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

    Thanks alot

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

    thank youu

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

    thanks...

  • @AhsanHabib-vt2dq
    @AhsanHabib-vt2dq 2 года назад

    Tnx a lot

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

      you are welcome! Don't forget to subscribe my channel for getting new updates in future!

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

    hello i can't access my div to make the select addition for the second dropdown... how can i reach my second select through my differents div ? please

  • @taslimsuman
    @taslimsuman 7 лет назад

    Thanks bonna, its nice tutorial. I just implemented this to my project. Why did u use append, you could use directly like $('#product').html(op); and its works fine. Can you help me to add this product in the cart just below this content? Which method I should use to save the bill and then cart data?

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

    How can i populate 'price' by dropdown, if 'price' has some line value and using textarea? I've tried to following your tutorial but there is no filled.. Kindly help me, i am new in Laravel and ajax

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

    Thanks br

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

    Items in my product name display as 'undefined'. Any suggestions on how I can fix this?

  • @martingitari5194
    @martingitari5194 4 года назад +2

    Awsome Tutorial i encountered an issue with the second drop down not selecting.
    problem is that i had div=$(this).parent(); it took time for me to understand but thanks to comments below i found this solution it might help some one who might be facing same issue:
    Solution:
    if it covers ur required area then ok if not then try
    div=$(this).parent().parent();
    if it its not work then
    div=$(this).parent().parent().parent();

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

      Thanks Martin i was stuck in that for long, until I came to see if somebody was having the same problem, thanks to bons and thanks to you

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

      why mine still not working?

  • @alialnaeem7302
    @alialnaeem7302 7 лет назад

    Thank ..
    I have two questions ..
    How do I filter the filtered table again, not from the database but from the filtered table?
    Second: How to show data from another table by json.

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

    How to add Two dynamic drop box into same form I have a problem with second dynamic Undefined variable i change different variable but its wrong

  • @123_nguyenminhhai3
    @123_nguyenminhhai3 Год назад

    Chuẩn đến bây giờ - Prepare until now

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

    how it possible to call field from another table which is in database is not realtion?

  • @aaronwilson1149
    @aaronwilson1149 7 лет назад

    Bons,
    Awesome tutorial! I can get it to work great following your tutorial to the exact way it is. But;
    Question, If I added this dynamic drop down feature to the dashboard page of my user that is currently logged in, when the TestController goes to utilize the prodfunct method, is the return view still '/home' or 'user/home', or even 'user.home' or does the placement of the TestController matter also too. Does the TestController need to be placed in Controllers/UserAuth to work? As of right now, I'm receiving an ErrorException referencing the View?

    • @bons281
      @bons281  7 лет назад

      +Aaron Wilson
      thank you for warm praise..feeling blessed ^_^ ...i think your question didn't finished because after "my user that is currently logged in, when the " i don't see anything

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

    how add multiple product and when i remove product price auto update

  • @kkatsavaros
    @kkatsavaros 7 лет назад

    Hello , thanks for your videos. I would like to ask you is it easy to make a menu dynamically at the admin panel and show it in the front panel?

    • @bons281
      @bons281  7 лет назад

      hi, r u meaning navigation menu???? can u share ur logic or scenario that u wanna to do with these two page??

    • @kkatsavaros
      @kkatsavaros 7 лет назад

      yes mean navigation menu which made in an admin panel and upload pictures and text in front panel.Can we do that with Laravel?

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

    Man!!!! ur Amazing!!! I fought a little bit but I archieved the same result. A question: In laravel they use Route::resources to attach all controller's methods to that route. Must I declare an especific GET route for each AJAX calling in the web.php?

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

      Thanks, +Daniel......if ajax's URL route is available in web.php then u don't need to declare...coz it will create duplicacy and give error... like for example
      case 1:
      in web.php
      Route::resource('photos', 'PhotoController');
      in view (ajax part)
      $.ajax({
      type:'get',
      url:'{!!URL::to('/photos/create')!!}',
      well Route::resource('photos', 'PhotoController'); is actually the collection of following multiple single routes
      Route::get('photos', ['as'=> 'photos.index', 'uses' => 'PhotoController@functionname1']);
      Route::get('/photos/create', ['as'=> 'photos.create', 'uses' => 'PhotoController@functionname2']);
      Route::post('/photos', ['as'=> 'photos.store', 'uses' => 'PhotoController@functionname3']);
      Route::get('/photos/{photo}', ['as'=> 'photos.show', 'uses' => 'PhotoController@functionname4']);
      Route::get('/photos/{photo}/edit', ['as'=> 'photos.edit', 'uses' => 'PhotoController@functionname5']);
      Route::put('/photos/{photo}', ['as'=> 'photos.update', 'uses' => 'PhotoController@functionname6']);
      Route::delete('/photos/{photo}', ['as'=> 'photos.destroy', 'uses' => 'PhotoController@functionname7']);
      so ajax URL 'photos/create' is match with above Route::get('/photos/create', ['as'=> 'photos.create', 'uses' => 'PhotoController@functionname2']);
      in that case u don't need to declare another route in web.php just write Route::resource('photos', 'PhotoController');
      case 2:
      in view (ajax part)
      $.ajax({
      type:'get',
      url:'{!!URL::to('/photos/price')!!}',
      this ajax URL 'photos/price' does n't match with any of the above routes so u need to declare this route in web.php like
      Route::resource('photos', 'PhotoController');
      Route::get('photos/price', ['as'=> 'photos.price', 'uses' => 'Controllername@functionname']);

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

      Thanks in advance for your patience to answer me.
      In first case, you suggested me to use the photos create route but this route is used to render the new photo view. So, I should change the signature of this method from "create()" to "create(Request $request)" and test inside if there is some value into $request variable to determinate the final action of this method:
      1) My user really wants to create a new photo (original function)
      2) Oh no! My user just wants to solve the 2nd select input values
      If I'd be right above, Doesnt the code become a little confuse or is it a convencional way to solve that into laravel's programmers comunity? I really like clear and organized code.
      Finally, you were using the AJAX GET method to access your controller. Usually the GET form's method writes all the request's parameters into browser URL. I suppose AJAX doesnt because it doesnt need to reload the page to work. Right? Could I use the POST AJAX Method? If yes, Should I pass the token value as 2nd parameter in order to respect Lavarel's security? What the diference between both? Just for curiosity, Could you give me a litle explanation?
      Sorry for the questions. Im try to survive into web programming environment :)

  • @sangharshramteke9330
    @sangharshramteke9330 Год назад

    in my code not working values are coming from database but not showing in select option..why?

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

    Thanks man! Great job. Try talking please!

  • @laraali3277
    @laraali3277 7 лет назад

    What is the correct way to send two values ​​.. How to receive AJAX ??

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

    When iam create data and sumbmit, why error undefined?

  • @muhammadfirdaus4715
    @muhammadfirdaus4715 3 года назад +2

    Thanks u very much. I can completed my project. But i wanna to ask u, the data which insert to database is an "id", cause the option value is "id".
    How can we insert the option value become "product name"?
    Thanks before

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

      what is id attribute name of this "product name"?? can you share your code here then it would be easy to answer you

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

      I have done it bro.thank you so much

  • @aaronwilson1149
    @aaronwilson1149 7 лет назад

    Borna,
    When I do the POST based off of this Dependant Dropdown, the POST retrieves the Rather than the DATA IN Here! how to i get the POST to retrieve that data?

    • @luisjorgehiguerote
      @luisjorgehiguerote 7 лет назад

      Hi im getting the right values from the productcategory but productname div dont do nothing please help

  • @davidmukoro1166
    @davidmukoro1166 7 лет назад

    what if i want to display the output on the same page based on the selection from the first dropdown . How can i achieve this.

    • @bons281
      @bons281  7 лет назад

      i already shown that how to display .Based on the selection from the first drop down(product category),output(product name) is displayed in the product name dropdown .how will u show output, it actually depend on your own choice. you can display it in many ways like as text ,as dropdown options.here i showed as dropdown option and text input field value.u can watch the video from duration 17.01(line 52 ,data is the output based on 1st dropdown) to 19.34 period.

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

    May I ask? why when I want to try to see the data array of product categories that exist on the console with the name of the electronic category there is no data visible and the product name is also not there or empty .. what is wrong?

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

      Hi +imam rizki....It's tough to say what is the exact reason since I do not know your code.But I can help u to check step by step to find out the problem.
      first, try following code
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      console.log("hmm its change");
      var cat_id=$(this).val();
      console.log("cat_id");
      console.log(cat_id);
      var url_path='{!!URL::to('findProductName')!!}';
      console.log("full path");
      console.log(url_path);
      });
      });
      check your console to see what you get there.

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

      this my view code on productlist.blade.php
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      // console.log("hmm its change");
      var cat_id=$(this).val();
      // console.log(cat_id);
      var div=$(this).parent();
      var op=" ";
      $.ajax({
      type:'get',
      url:'{!!URL::to('findProductName')!!}',
      data:{'id':cat_id},
      success:function(data){
      //console.log('success');
      //console.log(data);
      //console.log(data.length);
      op+='chose product';
      for(var i=0;i

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

      Have you tried the following code ????...instead of above(the code you shared), try below code first....then in a browser right click and inspect ...go to console....refresh the page and change the drop-down ...check what you get in console.
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      console.log("hmm its change");
      var cat_id=$(this).val();
      console.log(cat_id);
      var url_path='{!!URL::to('findPrice')!!}';
      console.log(url_path);
      });
      });

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

    Hello, I keep getting: Uncaught ReferenceError: id is not defined. Any suggestions?

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

      Which line?? Can you mention??
      You can watch videos to solve prob .if still not solved please let me know
      1st video link[ voice explanation]: ruclips.net/video/4UXs3P0Q-h0/видео.html
      2nd video link [show a technique to solve a common prob] : ruclips.net/video/hk7B3f74ZVg/видео.html

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

    Excellent tutorial Sir. Please can you do the same in laravel 6?

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

      @henry, as far I know, it would not be a problem to deploy this same code for Laravel 6

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

      @@bons281 yes boss am trying it but it's not working. I have downloaded jQuery again but still not working. When I run the program and check from the browsers' console, I don't get any feedback.
      Please kindly try it at your end and let me know whether it's working so that I can figure out where the problem is coming from. Thank you

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

      @@henrynanabeyinagyapong1548 can you share your code with bonstutorial@gmail.com ???

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

      @@bons281 Ok I have sent it to your email

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

    can somebody tells me what should be written in "id" here
    data: {'id': pro_id},
    is this a variable ? we can take any variable? or is it a specific field name?

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

      here "id" is a user defined name which we will use in controller ,u can use anything like may be instead of id u could write employeeid ,but when you need to access the product_id value u have to write 'employeeid ' you could say it is a nickname which you will call in controller if you need.
      pro_id is a variable where in this video we store the product name id, and since we have to find the data from database depend on this product name id (pro_id),so we have to sent this pro_id variable to controller to do the query that's why we use ajax but in ajax data portion what we did we gave a nick name called 'id' which is a user defined and can be changeable name (u can write the name according to your choice) and in controller nickname is recognizable they only know this nickname and in controller via this nickname they will understand actually it is the pro_id variable.
      data: {'id': pro_id}, ==== data: {the_nickname_of_variable_that_we_give_according_to_ourchoice : variable },
      hope u understand if not ,pls let me know. and very soon i will publish a video with audio about similar type video hope everyone get clearmore.

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

      @@bons281 finally code is working, thanks alot fatema!!!!

  • @jiahui-kt8st
    @jiahui-kt8st 6 лет назад

    the url did not direct me to the findproductname , please help me thank you

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

      hi try to write following code to check what URL r you getting
      1.write following code....
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      var urlprd='{!!URL::to('findProductName')!!}';
      console.log('urlprd');
      });
      2.then in your browser right click and click 'inspect' and go to 'console' ....refresh the browser and change the dropdown value and check what u get on the console.
      3.is this console URL match the URL suppose localhost/projectname/public/findProductName or localhost:portno/findProductName

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

    home:960 Uncaught SyntaxError: Unexpected token ) why this error is occuring

  • @rohitkapali
    @rohitkapali 7 лет назад

    I'm getting this error message in my console
    HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request.
    can you tell me what is wrong?

    • @rohitkapali
      @rohitkapali 7 лет назад

      seems like the problem is in the URL, but I don't know what

    • @bons281
      @bons281  7 лет назад

      hi rohit , are u using php artisan serve???????
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      var url='{!!URL::to('findProductName')!!}';
      console.log(url);
      });
      });
      check what r you getting in the console

    • @rohitkapali
      @rohitkapali 7 лет назад

      It's giving this URL
      localhost/mts/public/ajax_demand_post
      where ajax_demand_post is equal to findProductName

    • @bons281
      @bons281  7 лет назад

      and what is your project url ??is it
      localhost/mts/public/ or localhost:8800??
      i am meaning are you using laravel php serve??????

    • @rohitkapali
      @rohitkapali 7 лет назад

      bons not I'm not using artisan serve...is it why this is happening?

  • @luisjorgehiguerote
    @luisjorgehiguerote 7 лет назад

    Hi im getting the right values from the productcategory but productname div dont do nothing please help

    • @bons281
      @bons281  7 лет назад

      thanks for sharing your problem ,what input are you getting from console.log(data); i am referencing video 17.00 period line 52???

    • @luisjorgehiguerote
      @luisjorgehiguerote 7 лет назад

      hello bro thanks for your time im getting this, Array [ Object ]
      1:Object modelo:"P25M24"

    • @bons281
      @bons281  7 лет назад

      may be there is a possibility that its not getting the appended area where u wanna showcase the table. i am talking about var div=$(this).parent();....here u can check wheither or not its getting the area where u wanna show the table...u can test it like this way
      after div=$(this).parent(); write following line
      div.css('background-color','green');
      if it covers ur required area then ok if not then try
      div=$(this).parent().parent();
      div.css('background-color','green');
      it its not work then
      div=$(this).parent().parent().parent();
      div.css('background-color','green');
      its one way to check.if its not work then let me know??

    • @luisjorgehiguerote
      @luisjorgehiguerote 7 лет назад

      its covers the area with this div.css('background-color','green');

    • @bons281
      @bons281  7 лет назад

      but after what using
      div=$(this).parent();
      or
      $(this).parent().parent();
      or
      div=$(this).parent().parent().parent();

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

    2nd select option is getting undefine value. what will be the solution

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

      hi try this one
      ruclips.net/video/hk7B3f74ZVg/видео.html

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

      @@bons281 i tried. here is my code


      {!! Form:: label('Department Name:') !!}

      Select
      @foreach($departments as $department)
      {{$department->name}}
      @endforeach



      {!! Form:: label('Institution Name:') !!}

      Location name

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

      i'm getting the correct corresponding data but it shows as undefined

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

      please help me

  • @alialnaeem7302
    @alialnaeem7302 7 лет назад

    How to Displaying data from JSON in a table

    • @bons281
      @bons281  7 лет назад +1

      its simple like take a empty div with id or class attribute and then appending that just add this suppose like
      -Select-
      @foreach($prod as $cat)
      {{$cat->product_cat_name}}
      @endforeach
      in script
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      var cat_id=$(this).val();
      var div=$(this).parent();
      var op=" ";
      $.ajax({
      type:'get',
      url:'{!!URL::to('findProductName')!!}',
      data:{'id':cat_id},
      success:function(data){
      op+='';
      op+='SNProductNamePrice';
      for(var i=0;i

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

    If i'll work 2 column within one table then what need to do ?

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

      hi ..can you explain your prob more details???

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

      @@bons281you work on 2 different table . . i want to get data from 2 different column from one table.

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

      @@MdShamimRezabanglasong same case.. just u have to change your query if i think your case right way

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

      First column data retrieve successful but 2nd column data isn't coming.

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

      @@MdShamimRezabanglasong hi can you plz share your query

  • @fikriabdul6759
    @fikriabdul6759 7 лет назад

    Hi, your gitlab link was broken, can u pls provide the working one?thanks

    • @bons281
      @bons281  7 лет назад +1

      hi, +Abdul gitlab link is recovered. please try go the link again gitlab.com/Bons/laravel5.3_dynamic_dropdown/tree/master
      for download the project,go to above link,then at the top right side of the page there is download option.
      let me know whether you can access the page or not .thanks

    • @fikriabdul6759
      @fikriabdul6759 7 лет назад

      thanks

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

    Anyone Pleas help. Im stuck in controller where the code line is:
    $data=Product::select('productname','id')->where('prod_cat_id',$request->id)->take(100)->get();
    I dont understand with the --------('productname','id')--------. Why we declare the attribute for this product table.? Can anyone help me to explain this line.

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

      hello aiman ...('productname','id') is not attribute...these two are table's column name.
      here table name is 'products' (which i define through Product model)
      and this table has 7 columns
      `id` , `productname` , `qty` , `price` , `prod_cat_id` , `created_at`, `updated_at`
      Since I need specific columns ..that's why
      by using ('productname','id'), I am selecting just these two columns because I don't need others columns for my task...if you want to take all the columns, it will not create a problem.

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

      Thank you sir for the explaination. Im really appreciate with the nice tutorial n support. :D

  • @raymondfigoinuhan4535
    @raymondfigoinuhan4535 Год назад

    sadly this tutorial not work to my project

  • @davidmukoro1166
    @davidmukoro1166 7 лет назад

    Dear Bon, Thanks so much for this video. It a great solution. Please, can you help me modify this tutorial such that i will output the result of the fetched products item into a table for a product category. I have tried and tried it but i am not getting it. Based on this tutorial , using console.log, i see i can grab the product category, and at the success call, it just display the whole page again. So, please help me on how to display the product item for instance for computer category into a table like
    SN
    ProductName
    Price
    This should display for all the product items that have computer category id. Please help me out. Thanks

    • @bons281
      @bons281  7 лет назад

      Hi +david glad that u share your prob.so u r getting the output based on project category but it could not display.
      i think may be there is a possibility that its not getting the appended area where u wanna showcase the table. i am talking about var div=$(this).parent();....here u can check wheither or not its getting the area where u wanna show the table...u can text it like this way
      after div=$(this).parent(); write following line
      div.css('background-color','green');
      if it covers ur required area then ok if not then try
      div=$(this).parent().parent();
      div.css('background-color','green');
      it its not work then
      div=$(this).parent().parent().parent();
      div.css('background-color','green');
      its one way to check.if its not work then let me know??

    • @davidmukoro1166
      @davidmukoro1166 7 лет назад

      @bon: Thanks so much for your prompt response. What you taught me in this tutorial works perfectly. but i now want to apply it to something else, which is displaying the result in a table instead of dropdown list. How can i achieve this. I am new to using laravel with ajax. can u help me with display the result from the DB based on the first selection into a table? Appreciate your prompt response.

    • @bons281
      @bons281  7 лет назад

      its simple like take a empty div with id or class attribute and then appending time just add this suppose like
      -Select-
      @foreach($prod as $cat)
      {{$cat->product_cat_name}}
      @endforeach
      in script
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      var cat_id=$(this).val();
      var div=$(this).parent();
      var op=" ";
      $.ajax({
      type:'get',
      url:'{!!URL::to('findProductName')!!}',
      data:{'id':cat_id},
      success:function(data){
      op+='';
      op+='SNProductNamePrice';
      for(var i=0;i

    • @davidmukoro1166
      @davidmukoro1166 7 лет назад

      Thanks, let me test and get back to you. Thank you very much.

  • @alialnaeem7302
    @alialnaeem7302 7 лет назад

    how to inner join with return json .. This is incorrect
    $data = Student::join('User','User.user_id','=','Student.user_id')->where('nameroom_id',$request->id)->paginate(10)->take(200);
    ..When I use inner join in any way, "$Request" does not work with me
    .. Thanks

    • @bons281
      @bons281  7 лет назад

      "$Request" does not work issue :do u add following line in controller
      use Illuminate\Http\Request;

    • @alialnaeem7302
      @alialnaeem7302 7 лет назад

      Yes use it ..
      use Illuminate\Http\Request;
      The way did not work with me.
      What solution is necessary for me more than a month depends on this error
      Thank bens ..

    • @bons281
      @bons281  7 лет назад

      add following in controller
      use DB;
      inside function add following
      $ff=DB::table(' Student')->join('User', ' Student.user_id', '=', 'User.user_id')->where('nameroom_id',$request->id)->get();
      var_dump($ff);
      +ali try above and check do u get data or not??
      can u provide your database ?????

    • @alialnaeem7302
      @alialnaeem7302 7 лет назад

      What if the price in another table is how it will come in value
      Meaning if the price is in a table for a unit ..
      Price: id, price
      ,,,, Table table product: price_id
      How do we bring the price peak ??
      I'm sorry I do not speak English .. I use google translate
      I would be very happy if you could solve this problem.

    • @bons281
      @bons281  7 лет назад

      hey +Rahama I am not able to understand your prob.what do you mean by peak- maximum, sum or top row data???and +Rahama this problem is not related to this video. it may can confused other users .you better share your problem with bonstutorial@gmail.com

  • @SHOHELRANA-nk2hc
    @SHOHELRANA-nk2hc 5 лет назад +1

    I love your video. it is really very helpful. Can i get your email?

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

      Thanks, @rana.Great to hear that you love it. mail address: bonstutorial@gmail.com

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

    i am not directing to the function of my controller
    Route::get('findlevel','controller\manageAdminController@getLevel');
    $.ajax({
    type:'get',
    URL:"{!!URL::to('findlevel')!!}",
    data:{'facultyname':facultyname},
    success:function(data){
    console.log('success');
    },
    error:function(){
    console.log('error');
    }
    });
    controller function
    public function getLevel(Request $request){
    echo "getlevel";
    $facultyname=$request->facultyname;
    $data=DB::table('levels')->get();
    return response()->json($data);
    }

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

      where is your manageAdminController located??? is it project/app/Http/Controllers/controller???

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

      yeah it is in project/app/Http/Controllers/controller

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

      url part of my code is not working, it is not directing to the controller function

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

      just try following to check what u found on console +narendra
      $(document).ready(function(){
      $(document).on('change','.productcategory',function(){
      var url="{!!URL::to('findlevel')!!}";
      console.log(url);
      });

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

      i got the output {{!!URL::to('getLevel')!!}}
      does it matters in syntax of ajax url in laravel 5.3 and laravel 5.4

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

    url: '{{!!URL::to('findProductName')!!}', this url not working. GET localhost:8000/%7Blocalhost:8000/findProductName?id=2 404 (Not Found)

  • @aaronwilson1149
    @aaronwilson1149 7 лет назад

    Hey Borna,
    My Response Video:
    ruclips.net/video/hrDibAu6sFQ/видео.html
    My project files:
    github.com/VisionsIC/ProjectSample
    the database sql export file is there as well. If you can provide some insight as to what i'm doing wrong let me know thank you.

    • @aaronwilson1149
      @aaronwilson1149 7 лет назад

      Also when I remove the @if(isset($unit)) and @endif that wrap the @foreach, it breaks the view. The @foreach loop is breaking the page...and I don't know why...

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

    hi my div.find('.productname').html(" "); and div.find('.productname').append(op); is not working.. i tried console.log the data and it is fine.

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

    Thanks