Skip to content

Instantly share code, notes, and snippets.

@maxwellnewage
Created October 31, 2012 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxwellnewage/3988656 to your computer and use it in GitHub Desktop.
Save maxwellnewage/3988656 to your computer and use it in GitHub Desktop.
Listbox que genera otro listbox
//escucha el cambio de provincia y guarda dicho valor en una variable. Luego la envia con metodo post a otro
//script php que trabaja la informacion y la devuelve generando las opciones de otro listbox
$(document).ready(function(){
$("#provincia").change(function () {
$("#provincia option:selected").each(function () {
elegido=$(this).val();
$.post("comprobar_registro.php", { elegido: elegido }, function(data){
$("#localidad").html(data);
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment