I am trying to use a link to submit a form, the kicker is not the name of the form. I can't seem to go to my form object.
$('a#deleteRecord').click(function(){
var $target = $(this).parent().next('form');
$target.submit();
});
From.
<form method="post" action=" <?php echo $_SERVER['PHP_SELF'] ?>" >
<input type="hidden" name="action" value="delete"/>
<input type="hidden" name="record" value="1"/>
<a id="deleteRecord" class="btn btn-danger" href="#" ><i class="fa fa-trash-o"></i></a>
Since I am creating a form from the database, you cannot name the form. Can someone please help me with this code or suggest a better solution. Thanks you
source
share