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?
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?
<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')
});