Friday 9 August 2013

PHP/javascript confirm() -- can't figure out what's wrong with this code

PHP/javascript confirm() -- can't figure out what's wrong with this code

If someone could troubleshoot I would be very grateful. I have copied and
pasted a javascript "confirm()" code block from w3c schools. I have
repeatedly double-checked the punctuation and braces, and still it won't
work. With the comment in place, the first alert box fires; but when I
remove the comments, then nothing happens, indicating that there is a
problem in the commented code. But for the life of me I can't find the
problem.
if (TRUE) {
echo "<script>
alert('test confirm box'); /*
var r = confirm('Title, Author, or Keyword not found.\nSearch again
ALL publishers, categories, and types?');
if (r==true)
{
alert('OK');
}
else
{
alert('cancel');
} */
</script>";
}

No comments:

Post a Comment