I have a table with several rows, which by clicking on submit button on each row, the information on each table will send to ajax, and will insert to database. after it clicked,I need to hide the button from table. How can I reach to this mission?
here are my codes:
<script type="text/javascript">
$(document).ready(function(){
$("#myform<?php echo $y; ?>").validate({
debug: false,
submitHandler: function(form) {
$.post('process.php', $("#myform<?php echo $y; ?>").serialize(), function(data) {
$('#results<?php echo $y; ?>').html(data);
});
}
});
});
My form:
<form name="myform" id="myform<?php echo $y; ?>" action="" method="POST">
<input type="text" name="name" id="name<?php echo $y; ?>" size="30" value=""/>
<input type="image" name="submit" id="accept<?php echo $y; ?> " value="Submit" src="graphics/accept.png">
</form>
<div id="results<?php echo $y; ?>"><div>
if you want to hide button only then you can use.