Hello,
I am trying to find a way to add a 'failsafe' on a <form> button that's used to delete a member of a script I'm workign on.The point being that a user has complained they have several times accidentally deleted a member, and they would like it to "ask them if they are sure" before it actually deleted the member.
The script is PHP, using HTML <form> code inside an echo statement. I thought a Javascript confirm box would be the perfect mechanism, but with my limited JS expertise have had a lot of trouble in the past trying to use JS and PHP together,
The existing code is something like this:
<form action=thispage.php>options=values method=post><input type=hidden name=session_stuff><input type=hidden name=formname value=sent><input type=hidden name=fac value=trash><input type=submit value=\"Delete\"></td></form>
So, given that it's inside a PHP echo statement, could I add an onClick code to it to make the user confirm before continuing? Or would somethign else be best? And either way, how? Would love any input on this.
Many thanks,
Kevin
I am trying to find a way to add a 'failsafe' on a <form> button that's used to delete a member of a script I'm workign on.The point being that a user has complained they have several times accidentally deleted a member, and they would like it to "ask them if they are sure" before it actually deleted the member.
The script is PHP, using HTML <form> code inside an echo statement. I thought a Javascript confirm box would be the perfect mechanism, but with my limited JS expertise have had a lot of trouble in the past trying to use JS and PHP together,
The existing code is something like this:
<form action=thispage.php>options=values method=post><input type=hidden name=session_stuff><input type=hidden name=formname value=sent><input type=hidden name=fac value=trash><input type=submit value=\"Delete\"></td></form>
So, given that it's inside a PHP echo statement, could I add an onClick code to it to make the user confirm before continuing? Or would somethign else be best? And either way, how? Would love any input on this.
Many thanks,
Kevin