Código Javascript:
Ver original
<script> function dirprop(){ var dir = document.getElementById ("dirprop").value; var tipvia = document.getElementById ("dirprop_tipovia").value; var numvia = document.getElementById ("dirprop_numvia").value; var apevia = document.getElementById ("dirprop_apevia").value; var orivia = document.getElementById ("dirprop_orivia").value; var numcrz = document.getElementById ("dirprop_numcruce").value; var apecrz = document.getElementById ("dirprop_apecruce").value; var oricrz = document.getElementById ("dirprop_oricruce").value; var numplaca = document.getElementById ("dirprop_numplaca").value; var comp = document.getElementById ("dirprop_complemento").value; dir = tipvia + ' ' +numvia; if(trim(apevia)!=''){ dir = dir + apevia; } if(trim(orivia)!=''){ dir = dir + ' ' + orivia; } if(trim(numcrz)!=''){ dir = dir + ' # ' + numcrz; } if(trim(apecrz)!=''){ dir = dir + apecrz; } if(trim(oricrz)!=''){ dir = dir + ' ' + oricrz; } if (trim(numplaca)!='') { dir = dir + ' ' + numplaca; } if (trim(comp)!='') { dir = dir + ' ' + comp; } document.getElementById("dirprop").value = dir; } </script>
Código HTML:
Ver original
<table align="center" width="95%"> <tr> <td width="25%" align="right"> <td width="75%" align="left"> <input type="text" id="dirprop" name="dirprop" value="" size="60" maxlength="128"> </td> </tr> </table> <center><table width="700px" border="0"> </tr> <tr width="100%"> <td width="90px"> <select id="dirprop_tipovia" name="dirprop_tipovia" value="" align="left" onChange="dirprop()"> </select> </td> <td width="40px"> <td width="50px"> <select id="dirprop_apevia" name="dirprop_apevia" value="" align="left" onChange="dirprop"> </select> </td> <td width="60px"> <select id="dirprop_orivia" name="dirprop_orivia" value="" align="left" onChange="dirprop"> </select> </td> <td width="40px"> CON </td> <td width="40px"> <td width="50px"> <select id="dirprop_apecruce" name="dirprop_apecruce" value="" align="left" onChange="dirprop"> </select> </td> <td width="60px"> <select id="dirprop_oricruce" name="dirprop_oricruce" value="" align="left" onChange="dirprop"> </select> </td> <td width="40px"> <td width="80px"> </tr> </table>