Hello, I would appreciate any help with this issue.
I'm trying to make some custom fields for a drop-down. Where when you Select "Renta" a text field will show, when you select "Venta", another text field will show, and when you select "Ambos" both text fields will show at the same time. I wonder if we can do that.
<script type="text/javascript">
function showHide()
{
if(document.getElementById('Tipo').value == 'Otro (Especifíque)')
document.getElementById('Especifíque').style.display = '';
else
document.getElementById('Especifíque').style.display = 'none';
}
</script>
<script type="text/javascript">
function showHide()
{
if(document.getElementById('RentaoVenta').value == 'Renta')
document.getElementById('Renta').style.display = '';
document.getElementById('Venta').style.display = 'none';
if(document.getElementById('RentaoVenta').value == 'Venta')
document.getElementById('Venta').style.display = '';
document.getElementById('Renta').style.display = 'none';
if(document.getElementById('RentaoVenta').value == 'Ambos')
document.getElementById('Renta').style.display = '';
document.getElementById('Venta').style.display = '';
else
document.getElementById('Renta').style.display = 'none';
document.getElementById('Venta').style.display = 'none';
}
</script>
<script type="text/javascript">
showHide();
</script>
<div class="componentheading">{global:formtitle}</div>
<table border="0">
<tr>
<td>{Número de Solicitud:caption}</td>
<td>{Número de Solicitud:body}<div class="clr"/>{Número de Solicitud:validation}</td>
<td>{Número de Solicitud:description}</td>
</tr>
<tr>
<td>{Nombre del Propietario:caption} (*)</td>
<td>{Nombre del Propietario:body}<div class="clr"/>{Nombre del Propietario:validation}</td>
<td>{Nombre del Propietario:description}</td>
</tr>
<tr>
<td>{Teléfono:caption} (*)</td>
<td>{Teléfono:body}<div class="clr"/>{Teléfono:validation}</td>
<td>{Teléfono:description}</td>
</tr>
<tr>
<td>{Correo-e:caption} (*)</td>
<td>{Correo-e:body}<div class="clr"/>{Correo-e:validation}</td>
<td>{Correo-e:description}</td>
</tr>
<tr>
<td>{Tipo:caption} (*)</td>
<td>{Tipo:body}<div class="clr"/>{Tipo:validation}</td>
<td>{Tipo:description}</td>
</tr>
<tr id="hide">
<td>{Especifíque:caption}</td>
<td>{Especifíque:body}<div class="clr"/>{Especifíque:validation}</td>
<td>{Especifíque:description}</td>
</tr>
<tr>
<td>{Dirección del Inmueble:caption} (*)</td>
<td>{Dirección del Inmueble:body}<div class="clr"/>{Dirección del Inmueble:validation}</td>
<td>{Dirección del Inmueble:description}</td>
</tr>
<tr>
<td>{Referencias de Ubicación:caption} (*)</td>
<td>{Referencias de Ubicación:body}<div class="clr"/>{Referencias de Ubicación:validation}</td>
<td>{Referencias de Ubicación:description}</td>
</tr>
<tr>
<td>{Superficie de Construcción en m²:caption} (*)</td>
<td>{Superficie de Construcción en m²:body}<div class="clr"/>{Superficie de Construcción en m²:validation}</td>
<td>{Superficie de Construcción en m²:description}</td>
</tr>
<tr>
<td>{Superficie de Terreno en m²:caption} (*)</td>
<td>{Superficie de Terreno en m²:body}<div class="clr"/>{Superficie de Terreno en m²:validation}</td>
<td>{Superficie de Terreno en m²:description}</td>
</tr>
<tr>
<td>{RentaoVenta:caption} (*)</td>
<td>{RentaoVenta:body}<div class="clr"/>{RentaoVenta:validation}</td>
<td>{RentaoVenta:description}</td>
</tr>
<tr id="hide">
<td>{Renta:caption}</td>
<td>{Renta:body}<div class="clr"/>{Renta:validation}</td>
<td>{Renta:description}</td>
</tr>
<tr id="hide">
<td>{Venta:caption}</td>
<td>{Venta:body}<div class="clr"/>{Venta:validation}</td>
<td>{Venta:description}</td>
</tr>
<tr>
<td>{Moneda:caption} (*)</td>
<td>{Moneda:body}<div class="clr"/>{Moneda:validation}</td>
<td>{Moneda:description}</td>
</tr>
<tr>
<td>{Comentarios:caption}</td>
<td>{Comentarios:body}<div class="clr"/>{Comentarios:validation}</td>
<td>{Comentarios:description}</td>
</tr>
<tr>
<td>{Código de Seguridad:caption}</td>
<td>{Código de Seguridad:body}<div class="clr"/>{Código de Seguridad:validation}</td>
<td>{Código de Seguridad:description}</td>
</tr>
<tr>
<td>{Enviar:caption}</td>
<td>{Enviar:body}<div class="clr"/>{Enviar:validation}</td>
<td>{Enviar:description}</td>
</tr>
</table>
<script type="text/javascript">
showHide();
</script>
Of course, I've already added
onchange="showHide();" to the Additional Attribute of RentaoVenta.
Thank you in advance.