Now I am going to hide this select input and this select input is depend to other select inputs values. So, I need select automatically drop down values to above select input using some technology. How can I do this? (currently it should select manually using drop down list)
actually I need javascript select to my selection input because In my application other dependent selection inputs are working on this selection inputs values
If you're just using javascript, you just need to trigger a change event on that dropdown after the page loads. That is equivalent to you manually changing it. If you have everything set up right, that should trigger your other events that listen to that change event on the dropdown we're talking about.
How are you doing it now? You apparently have a change event listener on the dropdown you're talking about as you mentioned if you change the value manually, it does something to the other inputs. Show your code. I don't know if your using a js library or vanilla js or what.
If you're using jQuery, it would just be a simple $('#c_id').change();
@Cronix I mean I can see value in the input box. ($categories->id) but as a result of that other depending selection boxes are not working. when I select values manually again then, it is working. so, I need fix this problem... I mean same result after your answers and currently my codes also...
remove the code that we already used to select the first element in the view file in the loop. Then as first line of your js, select it with js. Maybe that will help. Not sure as Im still not understanding everything here and we've deviated from your original question, which was answered properly.
$(document).ready(function(){
// select first option in #c_id dropdown
$("#c_id").val($("#c_id option:first").val());
$('.dynamic').change(function(){
// ..rest of your code