I currently have this.
//other stuff up here - not important
echo "<td><form action='redeem.php' method='post' id='form'><input type='hidden' name='redeem' value='1' /><input type='hidden' name='id' value='" . $id . "' /><input type='submit' name='Redeem' value='Redeem'></form></td>";
} else {
echo "<td><form action='redeem.php' method='post' id='form'><input type='hidden' name='redeem' value='0' /><input type='hidden' name='id' value='" . $id . "' /><input type='submit' name='Un-Redeem' value='Un-Redeem'></form></td>";
//other stuff down here - not important
and I want to change it so that when you press:
a) the ‘Redeem’ SUBMIT button it alerts you saying, “Are you sure you want to Redeem?”
b) the ‘Un-Redeem’ SUBMIT button it alerts you saying, “Are you sure you want to Un-Redeem?”
I have tried a few of them including the ONCLICK on the submit but none worked.. and I believe that is because I have it in an ECHO and I had to remove the (“) quotation marks which stopped the function from happening.
Anyone know another way I can do it?
Here is the solution :
Edit:
Added escaping character in here: