Member Deletion Not working

Can someone spot my error? When I click the delete button it doesn’t even change the page. Just closes out the javascript box and stays on the same page, like its not picking up the form section at all.

[php]$queryProspects = mysql_query(“SELECT * FROM spd_clients WHERE status=‘invited’ ORDER BY nextfollowup ASC”);
while($row = mysql_fetch_array($queryProspects)) {
$id = $row[‘id’];
$firstname = $row[‘fname’];
$lastname = $row[‘lname’];
$nextfollowup = $row[‘nextfollowup’];
$nextfollowup = strftime("%m/%d/%Y", strtotime($nextfollowup));
$status = $row[‘status’];
$phone = $row[‘phone’];
$phone1 = substr("$phone", -10, 3);
$phone2 = substr("$phone", -7, 3);
$phone3 = substr("$phone", -4);
$email = $row[‘email’];
$prospects .= “<form name=“deleteaccount$id” action=“delaccount.php” method=“post”>
<input name=“userid” type=“hidden” value=”$id" />
<input name=“fname” type=“hidden” value="$firstname" />
<input name=“lname” type=“hidden” value="$lastname" />
<input name=“status” type=“hidden” value="$status" />
<input name=“checkVar” type=“hidden” value=“parse” />

$firstname $lastname
<td class=“center”>($phone1) $phone2-$phone3
<td class=“center”>$email
<td class=“center”>$nextfollowup
<td class=“center”>
<a class=“btn btn-success” href=“profile.php?id=$id”>
<i class=“icon-zoom-in icon-white”>

<a class=“btn btn-info” href=“editclient.php?id=$id”>
<i class=“icon-edit icon-white”>

<a class=“btn btn-setting btn-danger” href=“javaScript:document.deleteaccount$id.submit()” onClick=“return confirm(‘Are you sure you want to delete $firstname $lastname?’);”>
<i class=“icon-trash icon-white”>


Try this, change name=“deleteaccount$id” to id=“deleteaccount$id”

Then, document.deleteaccount$id.submit() to document.forms[‘deleteaccount$id’].submit()

Sponsor our Newsletter | Privacy Policy | Terms of Service