Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/11/2013, 11:25
Avatar de el_cesar
el_cesar
 
Fecha de Ingreso: mayo-2001
Ubicación: Cali
Mensajes: 2.423
Antigüedad: 23 años, 5 meses
Puntos: 20
Respuesta: Mostrar/Ocultar campos si se cumple funcion Estoy pegado!!!

Código PHP:
Ver original
  1. <div id="container1">
  2. <div align="right" style="padding-right:10px;">
  3.  
  4. <div style="float:right"><img src="images/Picture1.png"  style="width:250px;" /></div>
  5. <div class="sequence_text"><?php if(isset($_SESSION['fullname'])&&($_SESSION['fullname'] != "")){ echo $_SESSION['fullname'];}?></div>
  6. </div>
  7. </div>
  8. <div id="shadow2"></div>
  9.  
  10. <div id="container2">
  11.  
  12. <div id="formBox">
  13. <form name="form1" id="form1" method="post"  onSubmit="return checkEmpty();" action="process/<?php echo $action.'.php';?>">
  14. <input type="hidden" name="action" id="action" value="<?php if(isset($switch_option)&&($switch_option != "")){ echo $switch_option;}?>"   />
  15. <input type="hidden" name="page" id="page" value="2"  />
  16. <table width="100%" border="00" cellspacing="00" cellpadding="00">
  17.     <tr>
  18.     <td width="17%" height="81" colspan="2" align="center" valign="middle"><h2>DATOS GENERALES - Información Básica</h2>
  19.   <div style="text-align:left">En esta sección le solicitamos información básica sobre su persona, su familia y sobre otros temas de interés  general para DIAMANTE que ayudan a agilizar el proceso de selección. Agradecemos conteste todas las preguntas que apliquen en su caso.
  20.   </div>
  21. </td>
  22.   </tr>
  23.  
  24.  
  25.  
  26.  <tr>
  27.     <td height="45" colspan="2"><table width="100%" border="0" cellspacing="00" cellpadding="00" class="bgcolor">
  28.       <tr>
  29.         <td width="15.5%" height="37" align="left" valign="middle"><p><span class="error">*</span>Vive en</p></td>
  30.        
  31.         <td width="12%" align="left" valign="middle"><p>
  32.          <?php
  33.         $residence_type = array('Apartamento','Casa','Inquilinato');
  34.        
  35.        
  36.         ?>
  37.            <select name="residence_type" id="residence_type" class="drpdwn-sml">
  38.           <option selected="selected" value="" disabled="disabled">Seleccione</option>
  39.          
  40.         <?php foreach($residence_type as $value){?>
  41.          <option  <?php if(isset($canidateBasicDetails['residence_type'])&&($canidateBasicDetails['residence_type'] == $value)){?> selected="selected" <?php }?> value="<?php echo $value;?>"><?php echo $value;?></option>
  42.          
  43.          <?php } ?>
  44.          
  45.         </select>
  46.         <span class="error" id="error_residence_type" style="float:left"></span>
  47.         </p></td>
  48.        
  49.          <td width="10%" align="left" nowrap="nowrap" valign="middle"><p><span class="error">*</span>Desde cuándo vive ahí?</p></td>
  50.           <td width="20%" align="left" valign="middle">
  51.             &nbsp;&nbsp;&nbsp;
  52.          
  53.          
  54.           <?php
  55.         $months = array('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic');
  56.        
  57.         ?>
  58.           <select name="living_duration_month" id="living_duration_month" class="select" >
  59.           <option selected="selected" value="" disabled="disabled">Mes</option>
  60.         <?php
  61.         foreach($months as $val){
  62.        
  63.         ?>
  64.         <option <?php if(isset($canidateBasicDetails['living_duration_month'])&&($canidateBasicDetails['living_duration_month'] == $val)){?> selected="selected" <?php }?>  value="<?php echo $val;?>"><?php echo $val;?></option>
  65.         <?php  } ?>
  66.        
  67.                   </select>
  68.           <select name="living_duration_year" id="living_duration_year" class="select">
  69.           <option selected="selected" value="" disabled="disabled">Año</option>
  70.         <?php
  71.         for($i=date('Y')-50;$i<=date('Y');$i++){
  72.         ?>
  73.          <option  <?php if(isset($canidateBasicDetails['living_duration_year'])&&($canidateBasicDetails['living_duration_year'] == $i)){?> selected="selected" <?php }?> value="<?php echo $i;?>"><?php echo $i;?></option>
  74.          <?php }?>
  75.        
  76.           </select>
  77.         <span class="error" id="error_living_duration" style="float:left"></span>
  78.  
  79.          
  80.           </td>
  81.          
  82.         <td width="11%" align="left" valign="middle" nowrap="nowrap"><p>&nbsp;<span class="error">*</span>La vivienda es
  83. </p></td>
  84.    <td  align="left" valign="middle"><select name="residence_ownership_type" id="residence_ownership_type" class="select_mid" onchange="hide_show();">
  85.           <option selected="selected" value="" disabled="disabled">Seleccione</option>
  86.          <option value="Propia" <?php if(isset($canidateBasicDetails['residence_ownership_type'])&&($canidateBasicDetails['residence_ownership_type'] == "Propia")){?> selected="selected" <?php }?>>Propia</option>
  87.          <option value="Arrendada" <?php if(isset($canidateBasicDetails['residence_ownership_type'])&&($canidateBasicDetails['residence_ownership_type'] == "Arrendada")){?> selected="selected" <?php }?>>Arrendada</option>
  88.          
  89.           <option value="Prestada" <?php if(isset($canidateBasicDetails['residence_ownership_type'])&&($canidateBasicDetails['residence_ownership_type'] == "Prestada")){?> selected="selected" <?php }?>>Prestada</option>
  90.          
  91.         </select>
  92.          <span class="error" id="error_residence_ownership_type" style="float:left"></span>
  93.         </td>
  94.      
  95.       </tr>
  96.       </table></td>
  97.   </tr>
  98. <?php if(isset($canidateBasicDetails['residence_ownership_type'])&&($canidateBasicDetails['residence_ownership_type'] == "Arrendada")){
  99.   $display="";
  100.          }else{
  101.               $display="none";
  102.              
  103.              }?>
  104.   <tr id="showArrendada" style="display:<?php echo $display;?>">
  105.     <td  colspan="2"><table width="100%" border="00" cellspacing="00" cellpadding="00" class="bgcolor">
  106.       <tr>
  107.         <td width="30%" align="left" valign="middle" height="40"><p>Si es arrendatario, nombre del arrendador
  108. </p></td>
  109.         <td width="20%" align="left" valign="middle"><input type="text" name="landlord_name" id="landlord_name" value="<?php if(isset($canidateBasicDetails['landlord_name'])&&($canidateBasicDetails['landlord_name'] != "")){
  110.   echo $canidateBasicDetails['landlord_name'];
  111.  }?>" autocomplete="off" /></td>
  112.         <td  width="30%" align="left" valign="middle"><p>Teléfono del arrendador
  113. </p></td>
  114.         <td  width="20%" align="left" valign="middle"><input type="text" name="landlord_phone" id="landlord_phone" value="<?php if(isset($canidateBasicDetails['landlord_phone'])&&($canidateBasicDetails['landlord_phone'] != "")){
  115.   echo $canidateBasicDetails['landlord_phone'];
  116.  }?>" autocomplete="off" /></td>
  117.       </tr>
  118.     </table>
  119.     <tr>
  120.       <table width="100%" border="00" cellspacing="00" cellpadding="00" class="bgcolor">
  121.         <tr>
  122.         <td width="30%" height="38" align="left" valign="middle"><p><span class="error">*</span>Cuántas personas viven con Ud?
  123. </p></td>
  124.         <td width="20%" align="left" valign="middle"><p>
  125.           <input type="text" name="no_pople_living" id="no_pople_living" onkeyup="checkNum('no_pople_living','error_no_pople_living')"   value="<?php if(isset($canidateBasicDetails['no_pople_living'])&&($canidateBasicDetails['no_pople_living'] != "")){
  126.   echo $canidateBasicDetails['no_pople_living'];
  127.  }?>" autocomplete="off" />
  128.            <span class="error" id="error_no_pople_living" style="float:left"></span>
  129.                   </p></td>
  130.               <td colspan="2">    
  131.               <tr><table>
  132.         <td  align="left" valign="middle"><p><span class="error">*</span>Qué relación tiene con ellas?
  133. </p></td>
  134.         <td width="15%" align="left" valign="middle"><p>
  135.           <select name="relationship_type_them" id="relationship_type_them" class="select_mid">
  136.           <option selected="selected" value="" disabled="disabled">Seleccione</option>
  137.          <option value="Familia" <?php if(isset($canidateBasicDetails['relationship_type_them'])&&($canidateBasicDetails['relationship_type_them'] == "Familia")){?> selected="selected" <?php }?>>Familia</option>
  138.          <option value="Amigos" <?php if(isset($canidateBasicDetails['relationship_type_them'])&&($canidateBasicDetails['relationship_type_them'] == "Amigos")){?> selected="selected" <?php }?>>Amigos</option>
  139.            <option value="Inquilinos" <?php if(isset($canidateBasicDetails['relationship_type_them'])&&($canidateBasicDetails['relationship_type_them'] == "Inquilinos")){?> selected="selected" <?php }?>>Inquilinos</option>
  140.          
  141.          
  142.         </select>
__________________
Say no more.......