DrTrans Posted August 29, 2009 Share Posted August 29, 2009 if($screenstatus == "Declined") { print"<br> Screening: <font color=\"red\">$screenstatus</font></b>   <input type=\"submit\" name=\"approve\" value=\"Approve\"><hr>\n"; On Button click i want it to alert " Are you sure you want to approve," if you click yes it connects to the database and changes the field from 0 to 1. can this be done easily? Quote Link to comment Share on other sites More sharing options...
asmith Posted August 29, 2009 Share Posted August 29, 2009 You haven't showed us the part when it wants to changes the value of them field in the database. But the confirmation will be like this: if($screenstatus == "Declined") { print"<br> Screening: <font color=\"red\">$screenstatus</font></b>   <input type=\"submit\" name=\"approve\" value=\"Approve\" onclick=\"return confirm('Are you sure you want to approve?');\"><hr>\n"; Notice that it is a javascript code. (You can't fully rely on it, Cause it can be disabled) Quote Link to comment Share on other sites More sharing options...
trq Posted August 29, 2009 Share Posted August 29, 2009 onClick is a client side (Javascript) event, this is the PHP Coding Help board. Quote Link to comment Share on other sites More sharing options...
DrTrans Posted August 29, 2009 Author Share Posted August 29, 2009 I understand that. but once confirming the onClick event. how would i make PHP connect to database and change the value... Quote Link to comment Share on other sites More sharing options...
trq Posted August 29, 2009 Share Posted August 29, 2009 That would all be taken care of within the script your forms action points to. Quote Link to comment Share on other sites More sharing options...
DrTrans Posted August 29, 2009 Author Share Posted August 29, 2009 if i put in a <form action="approveapp.php"> before the <input type> code. It drops the button to the next line and puts in extra page breaks.. I want it on all a single line. Quote Link to comment Share on other sites More sharing options...
asmith Posted August 29, 2009 Share Posted August 29, 2009 Then you are using Internet Explorer XD try this: <form action="approveapp.php" style="margin:0px;"> Quote Link to comment Share on other sites More sharing options...
trq Posted August 29, 2009 Share Posted August 29, 2009 Again, this is not a php issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.