user3266957
user3266957

Reputation: 284

Confirmation message is not working

I am deleting a row from a table but before deleing i want a confirmation msg. I tried using onclick and onsubmit return confirm() but its not working. Any help would be nice.

 echo '<td><a href="#" title="Delete" rel='.$row['IO_ID'].' onsubmit="return confirm("Really Delete?"); class="button red">
        </a></td>';

Upvotes: 2

Views: 52

Answers (2)

dparsons
dparsons

Reputation: 2866

You have syntax errors in your echo. This works:

 <table>
      <tr>
           <td><a href="#" title="Delete" rel='.$row['IO_ID'].' onsubmit="return confirm('Really Delete?');" class="button red">test
    </a>
           </td>
     </tr>
</table>

Upvotes: 1

attila
attila

Reputation: 2219

It would be

onsubmit="return confirm('Really Delete?');"

Upvotes: 3

Related Questions