First of all, sorry for posting here, but on the correct secton of the forum there's no much action going on.
My question isn't really about php.
Look, I'm working on a CMS. Let's say that I have a table that lists all the users, each user has a "delete" link to, obviously, delete the user:
<td><a href="javascript:confirmDelete('1', 'user_name');" >delete</a></td>
the function:
function confirmDelete(id, user_name){
if (confirm("Are you sure you want to delete the user with name " + user_name + "?") == true){
document.adm.mydelete.value = id;
document.adm.submit();
}
}
This is working perfectly as I want, don't know if it does it the best way, though.
What I want to do is get this thing to work, if JavaScript is disabled on the user's machine.
I was trying something like:
<td><a onClick="javascript:confirmDelete('1', 'user_name');" href="/delete.php?id=1">delete</a></td>
I was thinking that by submiting the form using javascript the link/href would not matter, but id does!
Can anyone help me to downgrade my script?
I will appreciate your help!