$(function(){
})
$(function(){
})
$(function(){
})
$(function(){
})
$(function(){
$("#rut_contacto").Rut({
on_error : function(){
alert("Rut inválido");
$("#rut_contacto").val("");
}
});
$("#sugerenciasmodal").submit(function(e){
e.preventDefault();
$.post("./",$(this).serializeArray(),function(){
alert("Gracias por contactarse con nosotros.");
$("#sugerencias-modal .close").click();
});
return false;
})
})
var solicitar = function( ) {
var valid = true;
var msg = [];
$("[required]").each(function(){
if($(this).val() == "")
{
msg.push($(this).attr("id")+" es un campo obligatorio.");
valid = false;
}
});
if(valid == false)
{
alert(msg.join("\n"));
return false;
}
};
$(function(){
$("#region").change(function(){
console.log("hola");
var _tipo = document.getElementById("tipo");
_tipo.selectedIndex = "0";
if($(this).val() == "13101" && _tipo.length < 5){
$(_tipo).append('');
}else{
_tipo.remove(4);
}
//_tipo.13101
$(_tipo).append('')
$('#area').empty().append('');
});
$("#tipo").change(function(){
if($("#region").val() == ""){
alert("Debe seleccionar una Región");
return false;
}
if($("#tipo").val() == ""){
$('#area').empty().append('');
return false;
}
var region = $("#region").val();
var tipo = $("#tipo").val();
$('#area').empty().append('');
$.post("./", {'_ajax_':'getAreasCIE','region':region, 'tipo':tipo}, function(result){
$.each(result, function(i, field){
//$("div").append(field + " ");
$('#area').append('');
},"json");
//alert(result);
});
});
});
$(function(){
})
$(function(){
})