Little Problem
Little Problem
Hi
I am using a sample code found on a website it works fine other than it duplicates entry rather than changing existing post how do i fix it to change rather than add another entry? :
- <html>
<head>
<title>Hello world</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#CategoryFrm").submit(function(event) {
/* stop form from submitting normally */
event.preventDefault();
$.post( 'controller.php', $("#CategoryFrm").serialize(),
function( data ) {
$("#status").append(data);
}
);
});
});
</script>
</head>
<body>
<form action="/" method="post" id="CategoryFrm">
<input type="text" name="category">
<input type="submit" value="Save">
</form>
</body>
</html>