2015-11-06 61 views
0

我有一個小問題...我不知道發生了什麼,但提交事件正在工作,因爲當我點擊「ingresar」提交按鈕,它發送所有的數據。 但是當我按下輸入沒有任何反應。窗體不會觸發當我按下提交

我認爲問題是,我有一個表內的形式....

難道我錯了嗎?我認爲問題在這裏,因爲,正如我所說的,當我按Ingresar提交按鈕它發送數據。

Thx爲您的幫助! :)

<form id="forma-recurso" method="POST"> 
     <table > 
      <tr> 
      <td><p>Nombre recurso:</p></td> 
      <td><input type="text" class="campo nombre-recurso" maxlength="50"></td> 
      </tr> 
      <tr> 
       <td><p>Direcci&oacute;n:</p></td> 
       <td><input type="text" class="campo direccion-recurso" maxlength="50"></td> 
      </tr> 
      <tr> 
       <td><p>Descripci&oacute;n:</p></td> 
       <td><input type="text" class="campo descripcion-recurso" maxlength="100"></td> 
      </tr> 
      <tr> 
       <td><p>Tipo de punto de inter&eacute;s:</p></td> 
       <td><select type="text" class="campo tipo-pto-interes"> 

      <?php 

      $conexion=pg_connect("host= localhost port=5432 dbname=EmergenciesResponse user=postgres password=asdf"); 
      $registros=pg_query("select tipo_pto, tipo_pto_interes from tipos_ptos_interes where tipo_pto_interes BETWEEN 1 AND 4"); 
       while ($reg=pg_fetch_array($registros)) 
       { 
       echo "<option value=\"$reg[tipo_pto_interes]\">$reg[tipo_pto]</option><br>"; 
       } 

      pg_close($conexion); 
     ?>       



        </select></td> 
      </tr> 
      <tr> 
       <td><p>Latitud/longitud</p></td> 
       <td><input type="text" class="latlng" disabled></td> 
      </tr> 
      <tr> 
       <td class="salida-btn"><button class="btn-salir">Salir</button></td> 
       <td class="ingreso-boton"> <input type="submit" class="ingresar-recurso"value="Ingresar"></td> 
      </tr> 


    </table> 

</form> 
+0

你的表單沒有action標籤告訴它在哪裏提交。 – durbnpoisn

+0

它沒有它,因爲即時通訊使用jQuery。 :) –

+0

呃......我完全看不到所有的JQuery。如果你問爲什麼你的提交不起作用,提供正在提交的代碼可能會有所幫助。 – durbnpoisn

回答

2

你的HTML代碼似乎是好的,所以必須有東西在你的瀏覽器或PHP代碼:在「輸入提交」時提交按鈕是不存在的形式不工作否則,它應該工作。

0

你可以看到它是否使用檢查工具工作,按f12在瀏覽器中打開它,更改爲網絡選項卡,並嘗試點擊提交按鈕,如果事情發生了它的好。

我注意到在您的形式不使用操作表單屬性附加傷害,嘗試一下這樣的例子:http://www.w3schools.com/html/html_forms.asp

+0

即時通訊不使用動作,因爲即時通訊使用jQuery或我必須使用它嗎? –