...

View Full Version : Need help with confimation



kosaks
01-14-2012, 11:31 AM
Hello

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..
}
else
{
// do nothing..
}
</script>

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..

devnull69
01-14-2012, 11:39 AM
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.

kosaks
01-14-2012, 11:43 AM
Thanks sir...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum