Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

11closed

[Resolvido] diminuir codigo

Recommended Posts

ola

 

estou com um script enorme aqui gostaria de ajuda para diminuir ele

 

HTML

<li>Quantos *: <select name="qts" id="qts" onchange="ChamarInputs(); Somar();">                                  
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      <option value="6">6</option>
      <option value="7">7</option>
      <option value="8">8</option>
      <option value="9">9</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
      <option value="13">13</option>
      <option value="14">14</option>
      <option value="15">15</option>
      <option value="16">16</option>
      <option value="17">17</option>
      <option value="18">18</option>
      <option value="19">19</option>
      <option value="20">20</option>
      <option value="21">21</option>
      <option value="22">22</option>
      <option value="23">23</option>
      <option value="24">24</option>
      <option value="25">25</option>
      <option value="26">26</option>
      <option value="27">27</option>
      <option value="28">28</option>
      <option value="29">29</option>
      <option value="30">30</option>
      <option value="31">31</option>
      <option value="32">32</option>
      <option value="33">33</option>
      <option value="34">34</option>
      <option value="35">35</option>
      <option value="36">36</option>
      <option value="37">37</option>
      <option value="38">38</option>
      <option value="39">39</option>
      <option value="40">40</option>
      <option value="41">41</option>
      <option value="42">42</option>
      <option value="43">43</option>
      <option value="44">44</option>
      <option value="45">45</option>
      <option value="46">46</option>
      <option value="47">47</option>
      <option value="48">48</option>
      <option value="49">49</option>
      <option value="50">50</option>
     </select></li>

javascript

 

function ChamarInputs() {             	
var apart1 = document.getElementById("apart1");           	
var apart2 = document.getElementById("apart2");
var apart3 = document.getElementById("apart3"); 
var apart4 = document.getElementById("apart4");
var apart5 = document.getElementById("apart5");
var apart6 = document.getElementById("apart6");
var apart7 = document.getElementById("apart7");
var apart8 = document.getElementById("apart8");
var apart9 = document.getElementById("apart9");
var apart10 = document.getElementById("apart10");
var apart11 = document.getElementById("apart11");
var apart12 = document.getElementById("apart12");
var apart13 = document.getElementById("apart13");
var apart14 = document.getElementById("apart14");
var apart15 = document.getElementById("apart15");
var apart16 = document.getElementById("apart16");
var apart17 = document.getElementById("apart17");
var apart18 = document.getElementById("apart18");
var apart19 = document.getElementById("apart19");
var apart20 = document.getElementById("apart20");
var apart21 = document.getElementById("apart21");
var apart22 = document.getElementById("apart22");
var apart23 = document.getElementById("apart23");
var apart24 = document.getElementById("apart24");
var apart25 = document.getElementById("apart25");
var apart26 = document.getElementById("apart26");
var apart27 = document.getElementById("apart27");
var apart28 = document.getElementById("apart28");
var apart29 = document.getElementById("apart29");
var apart30 = document.getElementById("apart30");
var apart31 = document.getElementById("apart31");
var apart32 = document.getElementById("apart32");
var apart33 = document.getElementById("apart33");
var apart34 = document.getElementById("apart34");
var apart35 = document.getElementById("apart35");
var apart36 = document.getElementById("apart36");
var apart37 = document.getElementById("apart37");
var apart38 = document.getElementById("apart38");
var apart39 = document.getElementById("apart39");
var apart40 = document.getElementById("apart40");
var apart41 = document.getElementById("apart41");
var apart42 = document.getElementById("apart42");
var apart43 = document.getElementById("apart43");
var apart44 = document.getElementById("apart44");
var apart45 = document.getElementById("apart45");
var apart46 = document.getElementById("apart46");
var apart47 = document.getElementById("apart47");
var apart48 = document.getElementById("apart48");
var apart49 = document.getElementById("apart49");
var apart50 = document.getElementById("apart50");
var valorCombo = document.getElementById("qts").value;                                                            	

apart1.style.display = "none";            	
apart2.style.display = "none";
apart3.style.display = "none"; 
apart4.style.display = "none";
apart5.style.display = "none";
apart6.style.display = "none";
apart7.style.display = "none";
apart8.style.display = "none";
apart9.style.display = "none";
apart10.style.display = "none";
apart11.style.display = "none";
apart12.style.display = "none";
apart13.style.display = "none";
apart14.style.display = "none";
apart15.style.display = "none";
apart16.style.display = "none";
apart17.style.display = "none";
apart18.style.display = "none";
apart19.style.display = "none";
apart20.style.display = "none";
apart21.style.display = "none";
apart22.style.display = "none";
apart23.style.display = "none";
apart24.style.display = "none";
apart25.style.display = "none";
apart26.style.display = "none";
apart27.style.display = "none";
apart28.style.display = "none";
apart29.style.display = "none";
apart30.style.display = "none";
apart31.style.display = "none";
apart32.style.display = "none";
apart33.style.display = "none";
apart34.style.display = "none";
apart35.style.display = "none";
apart36.style.display = "none";
apart37.style.display = "none";
apart38.style.display = "none";
apart39.style.display = "none";
apart40.style.display = "none";
apart41.style.display = "none";
apart42.style.display = "none";
apart43.style.display = "none";
apart44.style.display = "none";
apart45.style.display = "none";
apart46.style.display = "none";
apart47.style.display = "none";
apart48.style.display = "none";
apart49.style.display = "none";
apart50.style.display = "none";

if(valorCombo == 1) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "none";
 apart3.style.display = "none"; 
 apart4.style.display = "none";
 apart5.style.display = "none";
 apart6.style.display = "none";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 2) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "none"; 
 apart4.style.display = "none";
 apart5.style.display = "none";
 apart6.style.display = "none";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 3) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "none";
 apart5.style.display = "none";
 apart6.style.display = "none";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 4) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "none";
 apart6.style.display = "none";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 5) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "none";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 6) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "none";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 7) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "none";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 8) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "none";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 9) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "none";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 10) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "none";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 11) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "none";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 12) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "none";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 13) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "none";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 14) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "none";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 15) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "none";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 16) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "none";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 17) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "none";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 18) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "none";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 19) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "none";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 20) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "none";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 21) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "none";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 22) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "none";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 23) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "none";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 24) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "none";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 25) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "none";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 26) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "none";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 27) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "none";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 28) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "none";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 29) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "none";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 30) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "none";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 31) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "none";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 32) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "none";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 33) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "none";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 34) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "none";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 35) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "none";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 36) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "none";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 37) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "none";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 38) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "none";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 39) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "none";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 40) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "none";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 41) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "none";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 42) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "none";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 43) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "none";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 44) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "none";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 45) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "none";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 46) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "block";
 apart47.style.display = "none";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 47) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "block";
 apart47.style.display = "block";
 apart48.style.display = "none";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 48) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "block";
 apart47.style.display = "block";
 apart48.style.display = "block";
 apart49.style.display = "none";
 apart50.style.display = "none";  
} 
if(valorCombo == 49) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "block";
 apart47.style.display = "block";
 apart48.style.display = "block";
 apart49.style.display = "block";
 apart50.style.display = "none";  
} 
if(valorCombo == 50) {                            	
 apart1.style.display = "block"; 
 apart2.style.display = "block";
 apart3.style.display = "block"; 
 apart4.style.display = "block";
 apart5.style.display = "block";
 apart6.style.display = "block";
 apart7.style.display = "block";
 apart8.style.display = "block";
 apart9.style.display = "block";
 apart10.style.display = "block";
 apart11.style.display = "block";
 apart12.style.display = "block";
 apart13.style.display = "block";
 apart14.style.display = "block";
 apart15.style.display = "block";
 apart16.style.display = "block";
 apart17.style.display = "block";
 apart18.style.display = "block";
 apart19.style.display = "block";
 apart20.style.display = "block";
 apart21.style.display = "block";
 apart22.style.display = "block";
 apart23.style.display = "block";
 apart24.style.display = "block";
 apart25.style.display = "block";
 apart26.style.display = "block";
 apart27.style.display = "block";
 apart28.style.display = "block";
 apart29.style.display = "block";
 apart30.style.display = "block";
 apart31.style.display = "block";
 apart32.style.display = "block";
 apart33.style.display = "block";
 apart34.style.display = "block";
 apart35.style.display = "block";
 apart36.style.display = "block";
 apart37.style.display = "block";
 apart38.style.display = "block";
 apart39.style.display = "block";
 apart40.style.display = "block";
 apart41.style.display = "block";
 apart42.style.display = "block";
 apart43.style.display = "block";
 apart44.style.display = "block";
 apart45.style.display = "block";
 apart46.style.display = "block";
 apart47.style.display = "block";
 apart48.style.display = "block";
 apart49.style.display = "block";
 apart50.style.display = "block";  
}  

}

 

 

qual forma devo usar para diminuir ? tentei usar FOR mais ñ achei uma maneira adequada

 

alguem sabe como devo fazer ?

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

nossa cara.. hauhauhaua

 

que coisa absurda ^^

 

coloque um <fieldset>, para poder ter onde correr um loop.. ai você esconde todos, e só dá block no que enviar via parâmetro para essa function.

 

getElementsByTagName(), e um for()... só isso.

 

oque são os apart.. ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola

 

os apart são os inputs, olha !

HTML

<li id="apart1" style="display:none;">Nome 1*:<input type="text" name="apart1" /></li>
<li id="apart2" style="display:none;">Nome 2*:<input type="text" name="apart2" /></li>
<li id="apart3" style="display:none;">Nome 3*:<input type="text" name="apart3" /></li>
<li id="apart4" style="display:none;">Nome 4*:<input type="text" name="apart4" /></li>
........ etc

William Bruno pode me mostra um Exemplo:

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

algo assim:

<html>
<head>
<script type="text/javascript">
window.onload = function()
{
	var inputs_nomes = id('nomes').getElementsByTagName('label');
	hide( inputs_nomes );
	id('qts').onchange = function()
	{
		var qnts = this.value-1;
		
		hide( inputs_nomes );
		for( var i=0; i<=qnts; i++ ){
			inputs_nomes[i].style.display = 'block';
		}
	}
}
function id( el ){
	return document.getElementById( el );
}
function hide( arr ){
	for( var i=0; i<arr.length; i++ ){
		arr[i].style.display = 'none';
	}	
}
</script>
</head>
<body>
<form action="" method="post">
	<fieldset>
	<label>Quantos *: 
		<select name="qts" id="qts" onchange="Somar();">
			<option value="0">0</option>
<?php 
	for( $i=1; $i<=50; $i++ )
		echo '<option value="'.$i.'">'.$i.'</option>'.PHP_EOL;
?>
		</select></label>
	</fieldset>
	<fieldset id="nomes">
<?php
	for( $i=1; $i<=50; $i++ )
		echo '<label>Nome '.$i.'*:<input type="text" name="apart'.$i.'" /></label>'.PHP_EOL;
?>
	</fieldset><!-- /nomes -->
</form>
</body>
</html>
mas ainda está 'feio'.. trabalhar com campos que talvez você não precise.. está carregando o HTML sem necessidade..

 

se os teus campos fossem:

<label>Nome 1*:<input type="text" name="apart[]" /></label>
seria muuuuuuito melhor de trabalhar, tanto com o js, qnto com o server-side.

http://forum.imasters.com.br/public/style_emoticons/default/joia.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola

estou com dois problema, olha

javascript

aqui no SELECT tem um onchange e ele paro de funcionar, porque sera ?????

<select name="qts" id="qts" onchange="Somar();" >

 

script do Somar

function id( el ){    	
return document.getElementById( el );
}
function Somar() {
var plano = new Array( 0, 0, 0, 0 );    	
var Apart = new Array( 0, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520 ); 		
var p = id('qts').value;    	
var f = id('Formapag').value; 
var A = parseInt( plano[f] ) + parseInt( Apart[p] ) + ",00R$";
var B = Apart[p]*6*30/100+",00R$";
var C = Apart[p]*12*50/100+",00R$";

if (f == "1" && p == "1" || f == "1" && p == "2" || f == "1" && p == "3" || f == "1" && p == "4" || f == "1" && p == "5" || f == "1" && p == "6" || f == "1" && p == "7" || f == "1" && p == "8" || f == "1" && p == "9" || f == "1" && p == "10" || f == "1" && p == "11" || f == "1" && p == "12" || f == "1" && p == "13" || f == "1" && p == "14" || f == "1" && p == "15" || f == "1" && p == "16" || f == "1" && p == "17" || f == "1" && p == "18" || f == "1" && p == "19" || f == "1" && p == "20" || f == "1" && p == "21" || f == "1" && p == "22" || f == "1" && p == "23" || f == "1" && p == "24" || f == "1" && p == "25" || f == "1" && p == "26" || f == "1" && p == "27" || f == "1" && p == "28" || f == "1" && p == "29" || f == "1" && p == "30" || f == "1" && p == "31" || f == "1" && p == "32" || f == "1" && p == "33" || f == "1" && p == "34" || f == "1" && p == "35" || f == "1" && p == "36" || f == "1" && p == "37" || f == "1" && p == "38" || f == "1" && p == "39" || f == "1" && p == "40" || f == "1" && p == "41" || f == "1" && p == "42" || f == "1" && p == "43" || f == "1" && p == "44" || f == "1" && p == "45" || f == "1" && p == "46" || f == "1" && p == "47" || f == "1" && p == "48" || f == "1" && p == "49" || f == "1" && p == "50") {
  document.getElementById('valor').value = A;
}
if (f == "2" && p == "1" || f == "2" && p == "2" || f == "2" && p == "3" || f == "2" && p == "4" || f == "2" && p == "5" || f == "2" && p == "6" || f == "2" && p == "7" || f == "2" && p == "8" || f == "2" && p == "9" || f == "2" && p == "10" || f == "2" && p == "11" || f == "2" && p == "12" || f == "2" && p == "13" || f == "2" && p == "14" || f == "2" && p == "15" || f == "2" && p == "16" || f == "2" && p == "17" || f == "2" && p == "18" || f == "2" && p == "19" || f == "2" && p == "20" || f == "2" && p == "21" || f == "2" && p == "22" || f == "2" && p == "23" || f == "2" && p == "24" || f == "2" && p == "25" || f == "2" && p == "26" || f == "2" && p == "27" || f == "2" && p == "28" || f == "2" && p == "29" || f == "2" && p == "30" || f == "2" && p == "31" || f == "2" && p == "32" || f == "2" && p == "33" || f == "2" && p == "34" || f == "2" && p == "35" || f == "2" && p == "36" || f == "2" && p == "37" || f == "2" && p == "38" || f == "2" && p == "39" || f == "2" && p == "40" || f == "2" && p == "41" || f == "2" && p == "42" || f == "2" && p == "43" || f == "2" && p == "44" || f == "2" && p == "45" || f == "2" && p == "46" || f == "2" && p == "47" || f == "2" && p == "48" || f == "2" && p == "49" || f == "2" && p == "50") {
  document.getElementById('valor').value = B;
}
if (f == "3" && p == "1" || f == "3" && p == "2" || f == "3" && p == "3" || f == "3" && p == "4" || f == "3" && p == "5" || f == "3" && p == "6" || f == "3" && p == "7" || f == "3" && p == "8" || f == "3" && p == "9" || f == "3" && p == "10" || f == "3" && p == "11" || f == "3" && p == "12" || f == "3" && p == "13" || f == "3" && p == "14" || f == "3" && p == "15" || f == "3" && p == "16" || f == "3" && p == "17" || f == "3" && p == "18" || f == "3" && p == "19" || f == "3" && p == "20" || f == "3" && p == "21" || f == "3" && p == "22" || f == "3" && p == "23" || f == "3" && p == "24" || f == "3" && p == "25" || f == "3" && p == "26" || f == "3" && p == "27" || f == "3" && p == "28" || f == "3" && p == "29" || f == "3" && p == "30" || f == "3" && p == "31" || f == "3" && p == "32" || f == "3" && p == "33" || f == "3" && p == "34" || f == "3" && p == "35" || f == "3" && p == "36" || f == "3" && p == "37" || f == "3" && p == "38" || f == "3" && p == "39" || f == "3" && p == "40" || f == "3" && p == "41" || f == "3" && p == "42" || f == "3" && p == "43" || f == "3" && p == "44" || f == "3" && p == "45" || f == "3" && p == "46" || f == "3" && p == "47" || f == "3" && p == "48" || f == "3" && p == "49" || f == "3" && p == "50") {
  document.getElementById('valor').value = C;
}
}

a outra duvida é de php, aqui nessa linha, eu gostaria de inserir um Value no input

echo '<label>Nome do Quarto '.$i.'*:<input type="text" name="apart'.$i.'"  onkeyup="mascara( this, alphanum ); minuscula(this)" /></label>'.PHP_EOL;
// O value é esse, ñ estou conseguindo implementar
value="<?php if (sizeof($erro) != 0) { echo $apart'.$i.'; } ?>"

 

alguem poderia me ajudar a resolver essas duas duvidas ?

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

$value = if (sizeof($erro) != 0) { echo $apart'.$i.'; };

echo '<label>Nome '.$i.'*:<input type="text" name="apart'.$i.'"  onkeyup="mascara( this, alphanum ); minuscula(this)" value="'.$value.'" /></label>'.PHP_EOL;

 

chame o teu Somar(), no window.onload() também.

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola

 

esta dano esse erro

Parse error: parse error in D:\wamp\www\.............on line 2417

nessa linha

$value = if (sizeof($erro) != 0) { echo "$apart".$i.""; };

 

como que eu faço para chamar as duas função no window.onload() ? tentei aqui de varias formas ñ obtive resultados.

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

coloca assim:

$value = sizeof($erro) != 0 ? $apart.$i : '';

mostre como tentou.. é simples..

 

window.onload = function()
{
  funcao1();
  funcao2();
}
...

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha eu tentei assim

 

window.onload = function(){

 function id( el ){    	
  return document.getElementById( el );
 }
 function Somar() {
  var plano = new Array( 0, 0, 0, 0 );    	
  var Apart = new Array( 0, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520 );     	
  var p = id('qts').value;    	
  var f = id('Formapag').value; 
  var A = parseInt( plano[f] ) + parseInt( Apart[p] ) + ",00R$";
  var B = Apart[p]*6*30/100+",00R$";
  var C = Apart[p]*12*50/100+",00R$";
  
  if (f == "1" && p == "1" || f == "1" && p == "2" || f == "1" && p == "3" || f == "1" && p == "4" || f == "1" && p == "5" || f == "1" && p == "6" || f == "1" && p == "7" || f == "1" && p == "8" || f == "1" && p == "9" || f == "1" && p == "10" || f == "1" && p == "11" || f == "1" && p == "12" || f == "1" && p == "13" || f == "1" && p == "14" || f == "1" && p == "15" || f == "1" && p == "16" || f == "1" && p == "17" || f == "1" && p == "18" || f == "1" && p == "19" || f == "1" && p == "20" || f == "1" && p == "21" || f == "1" && p == "22" || f == "1" && p == "23" || f == "1" && p == "24" || f == "1" && p == "25" || f == "1" && p == "26" || f == "1" && p == "27" || f == "1" && p == "28" || f == "1" && p == "29" || f == "1" && p == "30" || f == "1" && p == "31" || f == "1" && p == "32" || f == "1" && p == "33" || f == "1" && p == "34" || f == "1" && p == "35" || f == "1" && p == "36" || f == "1" && p == "37" || f == "1" && p == "38" || f == "1" && p == "39" || f == "1" && p == "40" || f == "1" && p == "41" || f == "1" && p == "42" || f == "1" && p == "43" || f == "1" && p == "44" || f == "1" && p == "45" || f == "1" && p == "46" || f == "1" && p == "47" || f == "1" && p == "48" || f == "1" && p == "49" || f == "1" && p == "50") {
   document.getElementById('valor').value = A;
  }
  if (f == "2" && p == "1" || f == "2" && p == "2" || f == "2" && p == "3" || f == "2" && p == "4" || f == "2" && p == "5" || f == "2" && p == "6" || f == "2" && p == "7" || f == "2" && p == "8" || f == "2" && p == "9" || f == "2" && p == "10" || f == "2" && p == "11" || f == "2" && p == "12" || f == "2" && p == "13" || f == "2" && p == "14" || f == "2" && p == "15" || f == "2" && p == "16" || f == "2" && p == "17" || f == "2" && p == "18" || f == "2" && p == "19" || f == "2" && p == "20" || f == "2" && p == "21" || f == "2" && p == "22" || f == "2" && p == "23" || f == "2" && p == "24" || f == "2" && p == "25" || f == "2" && p == "26" || f == "2" && p == "27" || f == "2" && p == "28" || f == "2" && p == "29" || f == "2" && p == "30" || f == "2" && p == "31" || f == "2" && p == "32" || f == "2" && p == "33" || f == "2" && p == "34" || f == "2" && p == "35" || f == "2" && p == "36" || f == "2" && p == "37" || f == "2" && p == "38" || f == "2" && p == "39" || f == "2" && p == "40" || f == "2" && p == "41" || f == "2" && p == "42" || f == "2" && p == "43" || f == "2" && p == "44" || f == "2" && p == "45" || f == "2" && p == "46" || f == "2" && p == "47" || f == "2" && p == "48" || f == "2" && p == "49" || f == "2" && p == "50") {
   document.getElementById('valor').value = B;
  }
  if (f == "3" && p == "1" || f == "3" && p == "2" || f == "3" && p == "3" || f == "3" && p == "4" || f == "3" && p == "5" || f == "3" && p == "6" || f == "3" && p == "7" || f == "3" && p == "8" || f == "3" && p == "9" || f == "3" && p == "10" || f == "3" && p == "11" || f == "3" && p == "12" || f == "3" && p == "13" || f == "3" && p == "14" || f == "3" && p == "15" || f == "3" && p == "16" || f == "3" && p == "17" || f == "3" && p == "18" || f == "3" && p == "19" || f == "3" && p == "20" || f == "3" && p == "21" || f == "3" && p == "22" || f == "3" && p == "23" || f == "3" && p == "24" || f == "3" && p == "25" || f == "3" && p == "26" || f == "3" && p == "27" || f == "3" && p == "28" || f == "3" && p == "29" || f == "3" && p == "30" || f == "3" && p == "31" || f == "3" && p == "32" || f == "3" && p == "33" || f == "3" && p == "34" || f == "3" && p == "35" || f == "3" && p == "36" || f == "3" && p == "37" || f == "3" && p == "38" || f == "3" && p == "39" || f == "3" && p == "40" || f == "3" && p == "41" || f == "3" && p == "42" || f == "3" && p == "43" || f == "3" && p == "44" || f == "3" && p == "45" || f == "3" && p == "46" || f == "3" && p == "47" || f == "3" && p == "48" || f == "3" && p == "49" || f == "3" && p == "50") {
   document.getElementById('valor').value = C;
  }

  //alert(resultado);
  
 }
 // FIM soma do valor em R$
 function Inputs(){ 	
  var inputs_nomes = id('nomes').getElementsByTagName('label');    	
  hide( inputs_nomes );    	
  id('qts').onchange = function() {            	
   var qnts = this.value-1;                            	
   hide( inputs_nomes );            	
   for( var i=0; i<=qnts; i++ ){                    	
    inputs_nomes[i].style.display = 'block';            	
   }    	
  }
 }
 function hide( arr ){    	
  for( var i=0; i<arr.length; i++ ){            	
   arr[i].style.display = 'none';    	
  }   	
 }
}

apareceu um input la no browser

Nome 51*:

 

o que esta errado ?

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

coloca a chamada da função, e não a declaração dentro do window.onload

Compartilhar este post


Link para o post
Compartilhar em outros sites

é assim ?

 

window.onload = function(){  
 Somar();  
 input();
}

dessa forma deu errado, quando eu seleciono qualquer nº no select sempre aparece apenas 1 input,

Nome 51*:....

e a função Somar() ñ se manifesta.

 

obs: dei um nome para função que faz os input aparecer

function Inputs(){

tenho que alterar algo lah no HTML ?

 

na barra de Statos do browser, quando eu seleciono 2 ou outro nº maior aparece esse erro

Mensagem: 'inputs_nomes[...].style' é nulo ou não é um objeto

 

t+

 

 

 

 

 

 

dessa forma deu errado, quando eu seleciono qualquer nº no select sempre aparece apenas 1 input,

Nome 51*:....

 

arrumei esse erro

era so fechar os dois for com { }

 

essa linha

$value = sizeof($erro) != 0 ? $apart.$i : '';
serve para se o usuario selecionar no select "10", aparecera 10 input para preencher se caso ele preencher 9 esquecer de 1, ao clikar no botão e atualizar a pagina os formularios preenchidos continuam preenchido, É para evitar ficar preenchendo tudo dinovo.

 

dessa forma que você falou para colocar, quando eu cliko no botão os valores dos values é numerado

Nome 1*: 1

Nome 2*: 2

Nome 3*: 3

ao invés de numeros, os valores dos input tinha que ser os valores dessas variaveis

$apart1 = $_POST["apart1"];

$apart2 = $_POST["apart2"];

$apart3 = $_POST["apart3"];

 

 

t+

 

desculpe, mais acho que me entenderam errado, o topico ainda ñ foi resolvido...

 

a função Somar() ainda ñ funciona

 

e o conteudo da $value esta numerado, o certo é o valor da $value ser o conteudo dessas variaveis

$apart1 = $_POST["apart1"];

$apart2 = $_POST["apart2"];

$apart3 = $_POST["apart3"];

...etc

 

entendeu ?

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

ai o teu problema já é com php..

 

$value = sizeof($erro) != 0 ? $_POST[ 'apart'.$i ] : '';

echo '<label>Nome '.$i.'*:<input type="text" name="apart'.$i.'"  onkeyup="mascara( this, alphanum ); minuscula(this)" value="'.$value.'" /></label>'.PHP_EOL;

qnto a tua função 'Somar()', era só chamar lá.. no mesmo lugar da outra:

        id('qts').onchange = function()
        {
                Somar();        
                //segue a implementação..
pois o evento é o mesmo, e o elemento é o mesmo

 

se você não estudar, e não tentar fazer, é impossível lhe ajudar

Compartilhar este post


Link para o post
Compartilhar em outros sites

ola, gente voltei a esse topico porque segue esse codigo...

 

estou com um erro grave aqui... na hora de somar os valores. na função somar()

 

olha nessa msm pagina tenho esses script

function Somar() {
 var plano = new Array( 0, 0, 0, 0 );    	
 var Apar = new Array( 0, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970, 980, 990, 1000, 1010, 1020 );     	
 var p = id('qts').value;    	
 var f = id('Formapag').value; 
 var A = parseInt( plano[f] ) + parseInt( Apar[p] ) + ",00R$";
 var B = Apar[p]*6*70/100+",00R$"; // 30% de desconto
 var C = Apar[p]*12*50/100+",00R$"; // 50% de desconto
 if (f == "1" && p == "1" || f == "1" && p == "2" || f == "1" && p == "3" || f == "1" && p == "4" || f == "1" && p == "5" || f == "1" && p == "6" || f == "1" && p == "7" || f == "1" && p == "8" || f == "1" && p == "9" || f == "1" && p == "10" || f == "1" && p == "11" || f == "1" && p == "12" || f == "1" && p == "13" || f == "1" && p == "14" || f == "1" && p == "15" || f == "1" && p == "16" || f == "1" && p == "17" || f == "1" && p == "18" || f == "1" && p == "19" || f == "1" && p == "20" || f == "1" && p == "21" || f == "1" && p == "22" || f == "1" && p == "23" || f == "1" && p == "24" || f == "1" && p == "25" || f == "1" && p == "26" || f == "1" && p == "27" || f == "1" && p == "28" || f == "1" && p == "29" || f == "1" && p == "30" || f == "1" && p == "31" || f == "1" && p == "32" || f == "1" && p == "33" || f == "1" && p == "34" || f == "1" && p == "35" || f == "1" && p == "36" || f == "1" && p == "37" || f == "1" && p == "38" || f == "1" && p == "39" || f == "1" && p == "40" || f == "1" && p == "41" || f == "1" && p == "42" || f == "1" && p == "43" || f == "1" && p == "44" || f == "1" && p == "45" || f == "1" && p == "46" || f == "1" && p == "47" || f == "1" && p == "48" || f == "1" && p == "49" || f == "1" && p == "50" || f == "1" && p == "51" || f == "1" && p == "52" || f == "1" && p == "53" || f == "1" && p == "54" || f == "1" && p == "55" || f == "1" && p == "56" || f == "1" && p == "57" || f == "1" && p == "58" || f == "1" && p == "59" || f == "1" && p == "60" || f == "1" && p == "61" || f == "1" && p == "62" || f == "1" && p == "63" || f == "1" && p == "64" || f == "1" && p == "65" || f == "1" && p == "66" || f == "1" && p == "67" || f == "1" && p == "68" || f == "1" && p == "69" || f == "1" && p == "70" || f == "1" && p == "71" || f == "1" && p == "72" || f == "1" && p == "73" || f == "1" && p == "74" || f == "1" && p == "75" || f == "1" && p == "76" || f == "1" && p == "77" || f == "1" && p == "78" || f == "1" && p == "79" || f == "1" && p == "80" || f == "1" && p == "81" || f == "1" && p == "82" || f == "1" && p == "83" || f == "1" && p == "84" || f == "1" && p == "85" || f == "1" && p == "86" || f == "1" && p == "87" || f == "1" && p == "88" || f == "1" && p == "89" || f == "1" && p == "90" || f == "1" && p == "91" || f == "1" && p == "92" || f == "1" && p == "93" || f == "1" && p == "94" || f == "1" && p == "95" || f == "1" && p == "96" || f == "1" && p == "97" || f == "1" && p == "98" || f == "1" && p == "99" || f == "1" && p == "100") {
  document.getElementById('valor').value = A;
 }
 if (f == "2" && p == "1" || f == "2" && p == "2" || f == "2" && p == "3" || f == "2" && p == "4" || f == "2" && p == "5" || f == "2" && p == "6" || f == "2" && p == "7" || f == "2" && p == "8" || f == "2" && p == "9" || f == "2" && p == "10" || f == "2" && p == "11" || f == "2" && p == "12" || f == "2" && p == "13" || f == "2" && p == "14" || f == "2" && p == "15" || f == "2" && p == "16" || f == "2" && p == "17" || f == "2" && p == "18" || f == "2" && p == "19" || f == "2" && p == "20" || f == "2" && p == "21" || f == "2" && p == "22" || f == "2" && p == "23" || f == "2" && p == "24" || f == "2" && p == "25" || f == "2" && p == "26" || f == "2" && p == "27" || f == "2" && p == "28" || f == "2" && p == "29" || f == "2" && p == "30" || f == "2" && p == "31" || f == "2" && p == "32" || f == "2" && p == "33" || f == "2" && p == "34" || f == "2" && p == "35" || f == "2" && p == "36" || f == "2" && p == "37" || f == "2" && p == "38" || f == "2" && p == "39" || f == "2" && p == "40" || f == "2" && p == "41" || f == "2" && p == "42" || f == "2" && p == "43" || f == "2" && p == "44" || f == "2" && p == "45" || f == "2" && p == "46" || f == "2" && p == "47" || f == "2" && p == "48" || f == "2" && p == "49" || f == "2" && p == "50" || f == "2" && p == "51" || f == "2" && p == "52" || f == "2" && p == "53" || f == "2" && p == "54" || f == "2" && p == "55" || f == "2" && p == "56" || f == "2" && p == "57" || f == "2" && p == "58" || f == "2" && p == "59" || f == "2" && p == "60" || f == "2" && p == "61" || f == "2" && p == "62" || f == "2" && p == "63" || f == "2" && p == "64" || f == "2" && p == "65" || f == "2" && p == "66" || f == "2" && p == "67" || f == "2" && p == "68" || f == "2" && p == "69" || f == "2" && p == "70" || f == "2" && p == "71" || f == "2" && p == "72" || f == "2" && p == "73" || f == "2" && p == "74" || f == "2" && p == "75" || f == "2" && p == "76" || f == "2" && p == "77" || f == "2" && p == "78" || f == "2" && p == "79" || f == "2" && p == "80" || f == "2" && p == "81" || f == "2" && p == "82" || f == "2" && p == "83" || f == "2" && p == "84" || f == "2" && p == "85" || f == "2" && p == "86" || f == "2" && p == "87" || f == "2" && p == "88" || f == "2" && p == "89" || f == "2" && p == "90" || f == "2" && p == "91" || f == "2" && p == "92" || f == "2" && p == "93" || f == "2" && p == "94" || f == "2" && p == "95" || f == "2" && p == "96" || f == "2" && p == "97" || f == "2" && p == "98" || f == "2" && p == "99" || f == "2" && p == "100") {
  document.getElementById('valor').value = B;
 }
 if (f == "3" && p == "1" || f == "3" && p == "2" || f == "3" && p == "3" || f == "3" && p == "4" || f == "3" && p == "5" || f == "3" && p == "6" || f == "3" && p == "7" || f == "3" && p == "8" || f == "3" && p == "9" || f == "3" && p == "10" || f == "3" && p == "11" || f == "3" && p == "12" || f == "3" && p == "13" || f == "3" && p == "14" || f == "3" && p == "15" || f == "3" && p == "16" || f == "3" && p == "17" || f == "3" && p == "18" || f == "3" && p == "19" || f == "3" && p == "20" || f == "3" && p == "21" || f == "3" && p == "22" || f == "3" && p == "23" || f == "3" && p == "24" || f == "3" && p == "25" || f == "3" && p == "26" || f == "3" && p == "27" || f == "3" && p == "28" || f == "3" && p == "29" || f == "3" && p == "30" || f == "3" && p == "31" || f == "3" && p == "32" || f == "3" && p == "33" || f == "3" && p == "34" || f == "3" && p == "35" || f == "3" && p == "36" || f == "3" && p == "37" || f == "3" && p == "38" || f == "3" && p == "39" || f == "3" && p == "40" || f == "3" && p == "41" || f == "3" && p == "42" || f == "3" && p == "43" || f == "3" && p == "44" || f == "3" && p == "45" || f == "3" && p == "46" || f == "3" && p == "47" || f == "3" && p == "48" || f == "3" && p == "49" || f == "3" && p == "50" || f == "3" && p == "51" || f == "3" && p == "52" || f == "3" && p == "53" || f == "3" && p == "54" || f == "3" && p == "55" || f == "3" && p == "56" || f == "3" && p == "57" || f == "3" && p == "58" || f == "3" && p == "59" || f == "3" && p == "60" || f == "3" && p == "61" || f == "3" && p == "62" || f == "3" && p == "63" || f == "3" && p == "64" || f == "3" && p == "65" || f == "3" && p == "66" || f == "3" && p == "67" || f == "3" && p == "68" || f == "3" && p == "69" || f == "3" && p == "70" || f == "3" && p == "71" || f == "3" && p == "72" || f == "3" && p == "73" || f == "3" && p == "74" || f == "3" && p == "75" || f == "3" && p == "76" || f == "3" && p == "77" || f == "3" && p == "78" || f == "3" && p == "79" || f == "3" && p == "80" || f == "3" && p == "81" || f == "3" && p == "82" || f == "3" && p == "83" || f == "3" && p == "84" || f == "3" && p == "85" || f == "3" && p == "86" || f == "3" && p == "87" || f == "3" && p == "88" || f == "3" && p == "89" || f == "3" && p == "90" || f == "3" && p == "91" || f == "3" && p == "92" || f == "3" && p == "93" || f == "3" && p == "94" || f == "3" && p == "95" || f == "3" && p == "96" || f == "3" && p == "97" || f == "3" && p == "98" || f == "3" && p == "99" || f == "3" && p == "100") {
  document.getElementById('valor').value = C;
 }
}
// FIM soma do valor em R$
window.onload = function(){    	
 var inputs_nomes = id('nomes').getElementsByTagName('label');    	
 hide( inputs_nomes );    	
 id('qts').onchange = function() { 
  Somar();
  var qnts = this.value-1;                            	
  hide( inputs_nomes );            	
  for( var i=0; i<=qnts; i++ ){                    	
   inputs_nomes[i].style.display = 'block';            	
  }    	
 }
}
function hide( arr ){    	
 for( var i=0; i<arr.length; i++ ){            	
  arr[i].style.display = 'none';    	
 }   	
}
function id( el ){    	
 return document.getElementById( el );
}

e aqui, é o form para mostrar os resultados

<form method="post" name="form1" action="cad_apartamento.php?acao=cadastro">
<fieldset>    	
      <label>Quantos*:             	
       <select name="qts" id="qts">                    	
        <option value="<?php if (sizeof($erro) != 0) { echo $qts; } ?>" selected> <?php if (sizeof($erro) != 0) { echo $qts; } ?></option>
        <?php     	
         for( $i=1; $i<=100; $i++ ) {           	
          echo '<option value="'.$i.'">'.$i.'</option>'.PHP_EOL;
         }
        ?>            	
       </select>
      </label>    	
     </fieldset>
Forma de Pagamento*: 
      <select type="text" name="Formapag" id="Formapag" onchange="Somar()">
       <option value="<?php if (sizeof($erro) != 0) { echo $Formapag; } ?>" selected><?php if (sizeof($erro) != 0) { echo $Formapag; } ?></option>
       <option value="1">A</option>
       <option value="2">B</option>
       <option value="3">C</option>
      </select>
Valor Total do pagamento será: <input id="valor" name="valor" value="<?php if (sizeof($erro) != 0) { echo $valor; } ?>" readonly="readonly" />
</form>

o que acontece de errado é o seguinte, se no select qts se eu selecionar "1" e no Forma de Pagamento selecionar "A", sai o resultado "30,00R$" no input valor, ate aqui td certo, então se eu aperta o botão cadastrar e obter um erro por exemplo de Formulário obrigatório, os values continuarão com os msm resultados, se eu mudar o o select qts para "2" ou quanl outro nº o input valor continua com o resultado "30,00R$", parece que a function Somar para de funcionar.

Se eu deixar assim o cliente vai conseguir enganar a programação cadastrando qts ele quiser por 30,00R$....

 

alguem porfavor me ajuda.......

 

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.