title: Hidden input text submit with jquery
body: <p>I have a javascript var that returns the value of a input text ID "ven_prod", with the value of "ven_prod" I need to make a search in my database without submiting the page.</p>
  
  <p>I can't use a javascript var in the java code, so i've setted the value in a hidden input text ID "prod_hidden", but I need to submit it to get the value with the java code and make the search...How do I do it ?</p>
  
  <pre><code>&lt;input id="ven_prod" type="text" placeHolder="Código de Barras" autofocus&gt;
          &lt;input id="prod_hidden" type="text" value=""&gt;
  
          &lt;script&gt;    
              $('#ven_prod').keypress(function (e)
                      {
                          if(e.keyCode==13)
                          {
                              var table = document.getElementById('tbprodutos');
                               var tblBody = table.tBodies[0];  
                               var newRow = tblBody.insertRow(-1);
                               var prod = document.getElementById('ven_prod').value;
                               var qtd = document.getElementById('ven_qtd');
                               var barra = prod.substring(0, 12);
                               var num = prod.substring(14, 16);
                               document.getElementById('prod_hidden').value = barra;
                               var ref = &lt;%=pd.getProdutosBarra(request.getParameter("prod_hidden")).getPro_referencia()%&gt;;
  OR
                               var ref = &lt;%=pd.getProdutosBarra(JS VAR 'barras HERE).getPro_referencia()%&gt;;
  
                               if(prod.length==16) { 
                                 var newCell0 = newRow.insertCell(0);  
                                 newCell0.innerHTML = '&lt;td&gt;'+ref+'&lt;/td&gt;';
  
                                 var newCell1 = newRow.insertCell(1);  
                                 newCell1.innerHTML = '&lt;td&gt;'+num+'&lt;/td&gt;';  
  
                                 var newCell2 = newRow.insertCell(2);  
                                 newCell2.innerHTML = '&lt;td&gt;'+qtd.value+'&lt;/td&gt;';
  
                                 var newCell3 = newRow.insertCell(3);  
                                 newCell3.innerHTML = '&lt;td&gt;R$ '+valor+'&lt;/td&gt;';
  
                                 var newCell4 = newRow.insertCell(4);  
                                 newCell4.innerHTML = '&lt;td&gt;'+barra+'&lt;/td&gt;';
  
                                  document.getElementById('ref').value = '6755';
                                  document.getElementById('imgsrc').src = './?acao=Img&amp;pro_id=1';
                                  document.getElementById('valortotal').value = 'Testando novo valor';
                                  document.getElementById('ven_prod').value = '';
                                  document.getElementById('ven_qtd').value = '1';
  
                              } else {
  
                                  document.getElementById('ven_prod').value = '';
                                  document.getElementById('ven_qtd').value = '1';
                                  alert("Código de barras inválido!");
                              }
  
                              return false;
                          }
              });
          &lt;/script&gt;
  </code></pre>