- Sun Dec 09, 2018 12:48 pm
#821959
Hello everyone
I'm trying to use onload javascript function on a daynaform but i can not make it works, i hope you can help me out.
Here is my code:
I'm trying to use onload javascript function on a daynaform but i can not make it works, i hope you can help me out.
Here is my code:
Code: Select all
$("document").ready( function() {
location();
tipoUsuario();
$("#drpPais").setOnchange(location);
$("#drpTipoRadicacion").setOnchange(tipoUsuario);
});
function location() {
var pais = $("#drpPais").getValue();
if (pais == "CO")
{
$("#drpDepartamento").show()
$("#drpCiudad").show()
}
else
{
$("#drpDepartamento").hide();
$("#drpCiudad").hide();
}
}
function tipoUsuario() {
var usuario = $("#drpTipoRadicacion").getValue();
if (usuario == "0")
{
$("#subtitle0000000001").hide();
$("#drpTipoEntidad").hide();
$("#txtNit").hide();
$("#txtNombreEntidad").hide();
$("#subtitle0000000002").hide();
$("#subtitle0000000003").show();
$("#drpTipoDocumento").show();
$("#txtNumDoc").show();
$("#txtNombres").show();
$("#txtApellidos").show();
$("#drpPais").show();
$("#drpDepartamento").show();
$("#drpCiudad").show();
$("#txtDireccion").show();
$("#txtTelefono").show();
$("#txtCelular").show();
}
else if(usuario == "1")
{
$("#subtitle0000000001").show();
$("#drpTipoEntidad").show();
$("#txtNit").show();
$("#txtNombreEntidad").show();
$("#subtitle0000000002").show();
$("#subtitle0000000003").hide();
}
else
{
$("#subtitle0000000001").hide();
$("#drpTipoEntidad").hide();
$("#txtNit").hide();
$("#txtNombreEntidad").hide();
$("#subtitle0000000002").hide();
$("#subtitle0000000003").hide();
$("#drpTipoDocumento").hide();
$("#txtNumDoc").hide();
$("#txtNombres").hide();
$("#txtApellidos").hide();
$("#drpPais").hide();
$("#drpDepartamento").hide();
$("#drpCiudad").hide();
$("#txtDireccion").hide();
$("#txtTelefono").hide();
$("#txtCelular").hide();
}
}