Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
cambiar la entrada de selección en el cambio de otra entrada de selección

tengo más de 2 divs que tienen 2 entradas seleccionadas. cuando cambio branch_country, la otra branch_region cambia según el valor de branch_country a través de ajax.

 <div> <select class="branch_country></select> <select class="branch_region></select> </div> <div> </elect class="branch_country></select> <select class="branch_region></select> </div>

y aquí está mi código ajax

 $('.branch_governorate_select').on('change', function(e) { e.preventDefault(); console.log($(this).eq($(this))); var countryID = $(this).val(); var status = $(this).parent().parent().find('.modal-body').find('#select-status-calendar') .val(); var url = "{{ route('sett.doc_get_branch_region', ':id') }}"; url = url.replace(':id', countryID); if (countryID) { $.ajax({ url: url, type: "GET", dataType: "json", success: function(data) { region_input.empty(); $.each(data, function(key, value) { region_input.append('<option value="' + value.id + '">' + value.name + '</option>'); }); } }); } else { region_input.empty(); } });

funciona bien, pero cambia todas las entradas con la clase branch_region. pero necesito cambiar solo la entrada de selección branch_region que está dentro del mismo div

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!