0
I have a registration form that when clicking on document type, if "RG" has a function in JS that shows a field that is defined in css as style="display: None".
However when loading from the base when doing on the update page you would like that when loading the page if the document type field is filled with "RG" ai activates the function to show the issuing field.
I use this function for when changing the document field, if you choose "RG" it shows the issuing field.
<script type="text/javascript" DEFER="DEFER">
// INICIO FUNÇÃO DE MOSTRA ORGÃO EMISSOR
window.onload=function(){
document.getElementById('destypedoc').addEventListener('change', function () {
var style = this.value == 'RG' ? 'block' : 'none';
document.getElementById('hidden_div').style.display = style;
});
}
</script>
Perfect worked very well thanks
– Paulo Spiguel