1,105,450 Community Members

function next page pass id

Member Avatar
momonq1990
Junior Poster in Training
57 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

</head>

Code blocks are created by indenting at least 4 spaces
... and can span multiple lines

<body>

<script type="text/javascript">
function show_confirm($uid)
{
var r=confirm("Press a button!");
if (r==true)
  {
 <?php header(location: sample.php?id=$uid)?>
  }
else
  {
  alert("You pressed Cancel!");
  }
 }
</script>
</head>
 <body>

 <input type="button" onclick="show_confirm($uid)" value="delete command



" />

guy help me to this code.. a want to add javascript dialog box to my delete and then the function if yes it will submit the value of $uid to the next page to process the delete in php code. i want to know or any sample code there for passing id through function? and how?

LastMitch
Deleted Member
 
0
 

want to add javascript dialog box to my delete and then the function if yes it will submit the value of $uid to the next page to process the delete in php code. i want to know or any sample code there for passing id through function? and how?

You can try this:

http://stackoverflow.com/questions/8680491/javascript-confirm-with-php-function-afterward

Member Avatar
imBaCodes
Junior Poster
179 posts since Apr 2013
Reputation Points: 2 [?]
Q&As Helped to Solve: 20 [?]
Skill Endorsements: 9 [?]
 
1
 

Try These .. it may help you ..

<input type = button id = confirm />
<input type = button id = camcel />


$('#confirm').click(function(){

    //Store in u_ID the url of which page you want the user to redirect.
    Var u_ID = http://www.the_user_will_redirect_here.com;

     window.location.assign(u_ID)

});

$('#cancel').click(function(){

    alert('You pressed cancel')

});
Member Avatar
masterjiraya
Posting Whiz
327 posts since Jul 2008
Reputation Points: -3 [?]
Q&As Helped to Solve: 32 [?]
Skill Endorsements: 4 [?]
 
0
 

you cannot use direct Java scripting use jQuery instead like imBaCodes has posted is a form of jQuery

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article