We sometimes need to have a pop-up warning message displayed before redirecting to a different page. This is especially handy when you are updating a record and the user needs to do something on a different page, before he / she can continue. I am always forgetting the syntax, so I am adding it here for my own reference. (And everyone else's.) Lets say you have a graphic link like this: <a href="gallery_list.php"><img src="../back/images/add2.png" alt="Add Gallery" width="16" height="16" border="0"></a> To add the pop-up warning change the link to this. <a href="gallery_list.php" onclick="return confirm('<?php echo NXT_getResource("Are you sure?"); ?>');"><img src="../back/images/add2.png" alt="Add Gallery" width="16" height="16" border="0"></a> Obviously you can change the confirm('message') to whatever you like. |
|||||||||||
Although we try to ensure all the articles submitted are valid it is your responsibility to make sure you have backups before you use these suggestions on your pc or websites. |
|||||||||||
|
|||||||||||