Question: Hey guys I keep getting an error on my Update form and it's driving me nuts. I can't figure out where it's at? Any help would be appreciated.

```
<?php
include 'connect.php';
?>
<form action = 'updateclient.php' method= 'post'>

Select an ID: <input type="text" name="id"><br>
Update Name: <input type="text" name="name"><br>
Update Phone: <input type= "text" name ="phone"><br>
Update Email: <input typer = "text" name="email"><br>

<input type="submit" value="Submit">
</form>
<?php

$sql = "UPDATE Client SET name ='".$_POST['name']."',phone='".$_POST['phone']."',email ='".$_POST['email']."'" ;
$sql.= "WHERE ID = '"$_POST['id']"'";

$result = @mysqli_query($connect,$sql);
?>

```

Answer: 
Something like this should help.

```
$(function(){
    $("input[type='submit'][name='submit']").click(function(){
        $(this).attr("disabled", "disabled");
        return true;
    });
});

```

[Demo](http://jsfiddle.net/rahulsadasivan/fu595wLs/)
```
<input type="submit"  onclick="this.disabled=true;" name="submit" value="submit" >

```

Did not test it, but it should work.

Note: This is not a good solution - someone can disable js and spam you. You need to prevent this in the backend(in php).