Form Post Update don't work
Hi,
I have try this but not work, what it's my error? thanks
- <script type="text/javascript">
-
- $(document).ready(function() {
- $("#submitCliente").click(function(e){
-
- var formData = $("#updateClienteForm").serialize();
-
- $.ajax({
- type: "POST",
- url: "update_cliente.php",
- cache: false,
- data: formData,
- success: onSuccess
- });
-
- e.preventDefault();
- });
- });
- </script>
- <div data-role="content" data-theme="c">
- <form id="updateClienteForm" method="post">
-
-
- <label for="ragioneSociale">Ragione Sociale:</label>
- <input type="text" name="ragioneSociale" id="ragioneSociale" value="'.$r->RagioneSociale.'"/>
- <label for="idCliente">idCliente:</label>
- <input type="text" name="idCliente" id="idCliente" value="'.$r->idCliente.'"/>
- <div button data-icon="check" data-theme="b" id="submitCliente" type="submit">Salva</button></div>
- </form>
- </div>
update_cliente.php
- <?php
- include 'connection.php';
-
- $id_cliente = $_GET["idCliente"];
- $RagioneSociale = $_GET["RagioneSociale"];
- $sql = "UPDATE clienti SET RagioneSociale = ".$RagioneSociale." where idCliente = " . $id_cliente;
-
- mysql_query($sql);
- ?>