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
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
Wonderful tutorial. Love the way you take your time to make this work. Amazing
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!
Thanks a lot. Best of luck for learning
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.
+Hirschman nice to hear that it help you.thanks a ton.
It's works, I work in Laravel 5.6 , thank you!
Amazing tutorial Bons, Well done..!
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.
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
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.
@Marcos glad to hear that you find it useful.
Finally, i resolved my errors and thanks a lot !!!!!!!
Lovely tutorial. It is really helpful. Thank you
thanks, you save a lot of time for me .
thank you so much for this wonderful tutorial. It helped me with my project a lot.
great to hear that
Thanks man, that was awesome
Thanks for this tutorial. Really helps me in developing my project. Keep it up. Wish u have a nice day ;)
thanks +syamin for your nice feedback...wish u a nice day also
Great Job!!!
Thank you So much
Thanks bro..
Its help me a lot..
A nice tutorial.
Amazing Tutorial
GOD DAMN. BIG THANKS FOR AUTHOR!!!
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
thanks a ton @afolabi busari. It's my pleasure.
thank you so much this is very helpful
Thank you so much! made me pass my master studies. :-D
Welcome +Johannes Deyringer :D.Stay tuned with bonstutorials
Beautiful explanation bro. It was very helpful for me.
its really great to hear that nice compliment.thanks +haider
Thank you very much Brother for this topic i resolved my errors
thanks a ton @nadil.. don't forget to subscribe my channel
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
Glad to know that it work for you :D
you are awesome .i it's really a good job .wish happy day
+Asmaul thanks that u like that.stay tuned .
Thanks ... awesome tut..
thanks a ton @marvel
Thank you so much
nice tutorial bons
thanks a lot +Adam. chuffed to bits
thank you!
hi, love the tutorial, will this also change the values in the form field?
its very helpfull.
can make one more video -> how to save(insert) that dropdown selected values in database..?
thank you..
thank you!!!!
hello, great work, just wondering, how i can refresh a list of products using these drop-down as filters? cheers
very useful =] thx
Thanks , you save me , you got +1 Subscribe
Thanks pal!!
so glad...thanks
Thanks
Merci beaucoup
Thanks alot
thank youu
thanks...
Tnx a lot
you are welcome! Don't forget to subscribe my channel for getting new updates in future!
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
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?
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
Thanks br
Items in my product name display as 'undefined'. Any suggestions on how I can fix this?
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();
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
why mine still not working?
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.
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
Chuẩn đến bây giờ - Prepare until now
how it possible to call field from another table which is in database is not realtion?
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?
+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
how add multiple product and when i remove product price auto update
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?
hi, r u meaning navigation menu???? can u share ur logic or scenario that u wanna to do with these two page??
yes mean navigation menu which made in an admin panel and upload pictures and text in front panel.Can we do that with Laravel?
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?
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']);
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 :)
in my code not working values are coming from database but not showing in select option..why?
Thanks man! Great job. Try talking please!
What is the correct way to send two values .. How to receive AJAX ??
When iam create data and sumbmit, why error undefined?
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
what is id attribute name of this "product name"?? can you share your code here then it would be easy to answer you
I have done it bro.thank you so much
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?
Hi im getting the right values from the productcategory but productname div dont do nothing please help
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.
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.
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?
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.
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
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);
});
});
Hello, I keep getting: Uncaught ReferenceError: id is not defined. Any suggestions?
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
Excellent tutorial Sir. Please can you do the same in laravel 6?
@henry, as far I know, it would not be a problem to deploy this same code for Laravel 6
@@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
@@henrynanabeyinagyapong1548 can you share your code with bonstutorial@gmail.com ???
@@bons281 Ok I have sent it to your email
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?
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.
@@bons281 finally code is working, thanks alot fatema!!!!
the url did not direct me to the findproductname , please help me thank you
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
home:960 Uncaught SyntaxError: Unexpected token ) why this error is occuring
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?
seems like the problem is in the URL, but I don't know what
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
It's giving this URL
localhost/mts/public/ajax_demand_post
where ajax_demand_post is equal to findProductName
and what is your project url ??is it
localhost/mts/public/ or localhost:8800??
i am meaning are you using laravel php serve??????
bons not I'm not using artisan serve...is it why this is happening?
Hi im getting the right values from the productcategory but productname div dont do nothing please help
thanks for sharing your problem ,what input are you getting from console.log(data); i am referencing video 17.00 period line 52???
hello bro thanks for your time im getting this, Array [ Object ]
1:Object modelo:"P25M24"
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??
its covers the area with this div.css('background-color','green');
but after what using
div=$(this).parent();
or
$(this).parent().parent();
or
div=$(this).parent().parent().parent();
2nd select option is getting undefine value. what will be the solution
hi try this one
ruclips.net/video/hk7B3f74ZVg/видео.html
@@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
i'm getting the correct corresponding data but it shows as undefined
please help me
How to Displaying data from JSON in a table
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
If i'll work 2 column within one table then what need to do ?
hi ..can you explain your prob more details???
@@bons281you work on 2 different table . . i want to get data from 2 different column from one table.
@@MdShamimRezabanglasong same case.. just u have to change your query if i think your case right way
First column data retrieve successful but 2nd column data isn't coming.
@@MdShamimRezabanglasong hi can you plz share your query
Hi, your gitlab link was broken, can u pls provide the working one?thanks
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
thanks
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.
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.
Thank you sir for the explaination. Im really appreciate with the nice tutorial n support. :D
sadly this tutorial not work to my project
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
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??
@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.
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
Thanks, let me test and get back to you. Thank you very much.
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
"$Request" does not work issue :do u add following line in controller
use Illuminate\Http\Request;
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 ..
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 ?????
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.
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
I love your video. it is really very helpful. Can i get your email?
Thanks, @rana.Great to hear that you love it. mail address: bonstutorial@gmail.com
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);
}
where is your manageAdminController located??? is it project/app/Http/Controllers/controller???
yeah it is in project/app/Http/Controllers/controller
url part of my code is not working, it is not directing to the controller function
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);
});
i got the output {{!!URL::to('getLevel')!!}}
does it matters in syntax of ajax url in laravel 5.3 and laravel 5.4
url: '{{!!URL::to('findProductName')!!}', this url not working. GET localhost:8000/%7Blocalhost:8000/findProductName?id=2 404 (Not Found)
what is the error here
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.
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...
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.
Thanks