View Full Version : Need help with confimation

01-14-2012, 12:31 PM

Im trying to create a simple pop-up confirmation window using javascript.. Here it goes..

If the user click "OK" on the confirmation box.. the javascript will call a php function that function will trigger my php code to run...

lets say i have a php function

function deleteSomething($id){
// some php code here!...
and javascript function

<script language="JavaScript">
function confirm_entry()
input_box=confirm("Click OK or Cancel to Continue");
if (input_box==true)
// trigger php function to work..
// do nothing..

i know only very simple javascript.. I have a hard time on how to accomplish my problem.. can someone help me on this? any help will be appreciated..

01-14-2012, 12:39 PM
The keyword is AJAX. Without issuing a request to the (server side) PHP from the (client side) Javascript you cannot interact with PHP. AJAX is a way to setup such a request without the browser refreshing the complete page.

01-14-2012, 12:43 PM
Thanks sir...