Jump to content


Photo

Javascript URL Confirm


  • Please log in to reply
2 replies to this topic

#1 Chris.

Chris.

    Young Padawan

  • Members
  • Pip
  • 129 posts
  • Gender:Male

Posted 28 April 2007 - 03:55 PM

Well, I have a delete url for my tutorial system, and I am trying to make it where when you click a link you have to confirm via javascript first. This is what my url looks like

<a href='java script:void(0);' onclick=\"if(confirm('Are you sure you want to continue?')) { location.href='admin.php?action=$action&id=$row[0]\"; } else { return false; }'>$row[1]</a><br />

That is all within an echo, and within a while statement.

When I click the link to delete the url, I get no confirmation box, and nothing else happens. Anyone know how to fix this?

#2 SecondV

SecondV

    Young Padawan

  • Members
  • Pip
  • 28 posts
  • Gender:Male
  • Location:Kentucky
  • Interests:All things PHP &amp; MySQL :)

Posted 28 April 2007 - 04:35 PM

<a href='admin.php?action=$action&amp;id=$row[0]' onclick=\"return confirm('Are you sure you want to continue?');'>$row[1]</a><br />


#3 Chris.

Chris.

    Young Padawan

  • Members
  • Pip
  • 129 posts
  • Gender:Male

Posted 28 April 2007 - 05:52 PM

Thank you, worked perfect after I added a \" :P.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users