Jump to content

[SOLVED] (return confirm) problem


robert_gsfame

Recommended Posts

how to create a confirmation when link is clicked by user in php script

 

in html, it works when i put this

<a href="#" onclick="return confirm('Are you sure?')">link</a>

 

but when i put it into my php script, it didn't run

<?php echo "<a href='#' onclick='return confirm(Are you sure?)'>link</a>";?>

 

can help me with this one

 

 

Link to comment
https://forums.phpfreaks.com/topic/174322-solved-return-confirm-problem/
Share on other sites

dont you have to put in the:

<script language="javascript">
...
</script>

thing in your echo statement?

like:

<script language="javascript"><a href="#" onclick="return confirm('Are you sure?')">link</a></script>

i dont know javascript, but thats just my assumption

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.