Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

call php page under Javascript function

Is it Possible to call php page under Javascript function? I have an javascript function and I want to call php page if someone press okk

Here is my code so far

function show_confirm()
{
var r=confirm("Do You Really want to Refund money! Press ok to Continue ");
if (r==true)
  {
  alert("You pressed OK!");
  return true;
  }
else
  {
  alert("You pressed Cancel!");
  }
}

and this Js function i m using here

<td align="center"><input name="Refund" onclick="show_confirm()" type="submit" value="Refund" /></td>

now i want if user press okk then call other php page ...

like image 360
John Avatar asked Sep 18 '26 11:09

John


1 Answers

if you want to redirect to a page:yourphppage.php if the user pressed ok.

 function show_confirm()
 {
      var r=confirm("Do You Really want to Refund money! Press ok to Continue ");
      if (r==true)
        {
        window.location="yourphppage.php";
        return true;
        }
           else
        {
        alert("You pressed Cancel!");
        }
 }
like image 65
Mithun Satheesh Avatar answered Sep 21 '26 01:09

Mithun Satheesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!