Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Need help with confimation

    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
    PHP Code:
    function deleteSomething($id){
     
    // some php code here!...

    and javascript function
    Code:
    <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..

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks sir...


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •